<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: src/proto/grpc/testing/control.proto

namespace Grpc\Testing;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * Results of a single benchmark scenario.
 *
 * Generated from protobuf message <code>grpc.testing.ScenarioResult</code>
 */
class ScenarioResult extends \Google\Protobuf\Internal\Message
{
    /**
     * Inputs used to run the scenario.
     *
     * Generated from protobuf field <code>.grpc.testing.Scenario scenario = 1;</code>
     */
    protected $scenario = null;
    /**
     * Histograms from all clients merged into one histogram.
     *
     * Generated from protobuf field <code>.grpc.testing.HistogramData latencies = 2;</code>
     */
    protected $latencies = null;
    /**
     * Client stats for each client
     *
     * Generated from protobuf field <code>repeated .grpc.testing.ClientStats client_stats = 3;</code>
     */
    private $client_stats;
    /**
     * Server stats for each server
     *
     * Generated from protobuf field <code>repeated .grpc.testing.ServerStats server_stats = 4;</code>
     */
    private $server_stats;
    /**
     * Number of cores available to each server
     *
     * Generated from protobuf field <code>repeated int32 server_cores = 5;</code>
     */
    private $server_cores;
    /**
     * An after-the-fact computed summary
     *
     * Generated from protobuf field <code>.grpc.testing.ScenarioResultSummary summary = 6;</code>
     */
    protected $summary = null;
    /**
     * Information on success or failure of each worker
     *
     * Generated from protobuf field <code>repeated bool client_success = 7;</code>
     */
    private $client_success;
    /**
     * Generated from protobuf field <code>repeated bool server_success = 8;</code>
     */
    private $server_success;
    /**
     * Number of failed requests (one row per status code seen)
     *
     * Generated from protobuf field <code>repeated .grpc.testing.RequestResultCount request_results = 9;</code>
     */
    private $request_results;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Grpc\Testing\Scenario $scenario
     *           Inputs used to run the scenario.
     *     @type \Grpc\Testing\HistogramData $latencies
     *           Histograms from all clients merged into one histogram.
     *     @type \Grpc\Testing\ClientStats[]|\Google\Protobuf\Internal\RepeatedField $client_stats
     *           Client stats for each client
     *     @type \Grpc\Testing\ServerStats[]|\Google\Protobuf\Internal\RepeatedField $server_stats
     *           Server stats for each server
     *     @type int[]|\Google\Protobuf\Internal\RepeatedField $server_cores
     *           Number of cores available to each server
     *     @type \Grpc\Testing\ScenarioResultSummary $summary
     *           An after-the-fact computed summary
     *     @type bool[]|\Google\Protobuf\Internal\RepeatedField $client_success
     *           Information on success or failure of each worker
     *     @type bool[]|\Google\Protobuf\Internal\RepeatedField $server_success
     *     @type \Grpc\Testing\RequestResultCount[]|\Google\Protobuf\Internal\RepeatedField $request_results
     *           Number of failed requests (one row per status code seen)
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Src\Proto\Grpc\Testing\Control::initOnce();
        parent::__construct($data);
    }

    /**
     * Inputs used to run the scenario.
     *
     * Generated from protobuf field <code>.grpc.testing.Scenario scenario = 1;</code>
     * @return \Grpc\Testing\Scenario
     */
    public function getScenario()
    {
        return $this->scenario;
    }

    /**
     * Inputs used to run the scenario.
     *
     * Generated from protobuf field <code>.grpc.testing.Scenario scenario = 1;</code>
     * @param \Grpc\Testing\Scenario $var
     * @return $this
     */
    public function setScenario($var)
    {
        GPBUtil::checkMessage($var, \Grpc\Testing\Scenario::class);
        $this->scenario = $var;

        return $this;
    }

    /**
     * Histograms from all clients merged into one histogram.
     *
     * Generated from protobuf field <code>.grpc.testing.HistogramData latencies = 2;</code>
     * @return \Grpc\Testing\HistogramData
     */
    public function getLatencies()
    {
        return $this->latencies;
    }

    /**
     * Histograms from all clients merged into one histogram.
     *
     * Generated from protobuf field <code>.grpc.testing.HistogramData latencies = 2;</code>
     * @param \Grpc\Testing\HistogramData $var
     * @return $this
     */
    public function setLatencies($var)
    {
        GPBUtil::checkMessage($var, \Grpc\Testing\HistogramData::class);
        $this->latencies = $var;

        return $this;
    }

    /**
     * Client stats for each client
     *
     * Generated from protobuf field <code>repeated .grpc.testing.ClientStats client_stats = 3;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getClientStats()
    {
        return $this->client_stats;
    }

    /**
     * Client stats for each client
     *
     * Generated from protobuf field <code>repeated .grpc.testing.ClientStats client_stats = 3;</code>
     * @param \Grpc\Testing\ClientStats[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setClientStats($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Grpc\Testing\ClientStats::class);
        $this->client_stats = $arr;

        return $this;
    }

    /**
     * Server stats for each server
     *
     * Generated from protobuf field <code>repeated .grpc.testing.ServerStats server_stats = 4;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getServerStats()
    {
        return $this->server_stats;
    }

    /**
     * Server stats for each server
     *
     * Generated from protobuf field <code>repeated .grpc.testing.ServerStats server_stats = 4;</code>
     * @param \Grpc\Testing\ServerStats[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setServerStats($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Grpc\Testing\ServerStats::class);
        $this->server_stats = $arr;

        return $this;
    }

    /**
     * Number of cores available to each server
     *
     * Generated from protobuf field <code>repeated int32 server_cores = 5;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getServerCores()
    {
        return $this->server_cores;
    }

    /**
     * Number of cores available to each server
     *
     * Generated from protobuf field <code>repeated int32 server_cores = 5;</code>
     * @param int[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setServerCores($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32);
        $this->server_cores = $arr;

        return $this;
    }

    /**
     * An after-the-fact computed summary
     *
     * Generated from protobuf field <code>.grpc.testing.ScenarioResultSummary summary = 6;</code>
     * @return \Grpc\Testing\ScenarioResultSummary
     */
    public function getSummary()
    {
        return $this->summary;
    }

    /**
     * An after-the-fact computed summary
     *
     * Generated from protobuf field <code>.grpc.testing.ScenarioResultSummary summary = 6;</code>
     * @param \Grpc\Testing\ScenarioResultSummary $var
     * @return $this
     */
    public function setSummary($var)
    {
        GPBUtil::checkMessage($var, \Grpc\Testing\ScenarioResultSummary::class);
        $this->summary = $var;

        return $this;
    }

    /**
     * Information on success or failure of each worker
     *
     * Generated from protobuf field <code>repeated bool client_success = 7;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getClientSuccess()
    {
        return $this->client_success;
    }

    /**
     * Information on success or failure of each worker
     *
     * Generated from protobuf field <code>repeated bool client_success = 7;</code>
     * @param bool[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setClientSuccess($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::BOOL);
        $this->client_success = $arr;

        return $this;
    }

    /**
     * Generated from protobuf field <code>repeated bool server_success = 8;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getServerSuccess()
    {
        return $this->server_success;
    }

    /**
     * Generated from protobuf field <code>repeated bool server_success = 8;</code>
     * @param bool[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setServerSuccess($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::BOOL);
        $this->server_success = $arr;

        return $this;
    }

    /**
     * Number of failed requests (one row per status code seen)
     *
     * Generated from protobuf field <code>repeated .grpc.testing.RequestResultCount request_results = 9;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getRequestResults()
    {
        return $this->request_results;
    }

    /**
     * Number of failed requests (one row per status code seen)
     *
     * Generated from protobuf field <code>repeated .grpc.testing.RequestResultCount request_results = 9;</code>
     * @param \Grpc\Testing\RequestResultCount[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setRequestResults($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Grpc\Testing\RequestResultCount::class);
        $this->request_results = $arr;

        return $this;
    }

}

