• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?php
2# Generated by the protocol buffer compiler.  DO NOT EDIT!
3# source: src/proto/grpc/testing/messages.proto
4
5namespace Grpc\Testing;
6
7use Google\Protobuf\Internal\GPBType;
8use Google\Protobuf\Internal\RepeatedField;
9use Google\Protobuf\Internal\GPBUtil;
10
11/**
12 * Generated from protobuf message <code>grpc.testing.LoadBalancerStatsResponse</code>
13 */
14class LoadBalancerStatsResponse extends \Google\Protobuf\Internal\Message
15{
16    /**
17     * The number of completed RPCs for each peer.
18     *
19     * Generated from protobuf field <code>map<string, int32> rpcs_by_peer = 1;</code>
20     */
21    private $rpcs_by_peer;
22    /**
23     * The number of RPCs that failed to record a remote peer.
24     *
25     * Generated from protobuf field <code>int32 num_failures = 2;</code>
26     */
27    protected $num_failures = 0;
28    /**
29     * Generated from protobuf field <code>map<string, .grpc.testing.LoadBalancerStatsResponse.RpcsByPeer> rpcs_by_method = 3;</code>
30     */
31    private $rpcs_by_method;
32
33    /**
34     * Constructor.
35     *
36     * @param array $data {
37     *     Optional. Data for populating the Message object.
38     *
39     *     @type array|\Google\Protobuf\Internal\MapField $rpcs_by_peer
40     *           The number of completed RPCs for each peer.
41     *     @type int $num_failures
42     *           The number of RPCs that failed to record a remote peer.
43     *     @type array|\Google\Protobuf\Internal\MapField $rpcs_by_method
44     * }
45     */
46    public function __construct($data = NULL) {
47        \GPBMetadata\Src\Proto\Grpc\Testing\Messages::initOnce();
48        parent::__construct($data);
49    }
50
51    /**
52     * The number of completed RPCs for each peer.
53     *
54     * Generated from protobuf field <code>map<string, int32> rpcs_by_peer = 1;</code>
55     * @return \Google\Protobuf\Internal\MapField
56     */
57    public function getRpcsByPeer()
58    {
59        return $this->rpcs_by_peer;
60    }
61
62    /**
63     * The number of completed RPCs for each peer.
64     *
65     * Generated from protobuf field <code>map<string, int32> rpcs_by_peer = 1;</code>
66     * @param array|\Google\Protobuf\Internal\MapField $var
67     * @return $this
68     */
69    public function setRpcsByPeer($var)
70    {
71        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::INT32);
72        $this->rpcs_by_peer = $arr;
73
74        return $this;
75    }
76
77    /**
78     * The number of RPCs that failed to record a remote peer.
79     *
80     * Generated from protobuf field <code>int32 num_failures = 2;</code>
81     * @return int
82     */
83    public function getNumFailures()
84    {
85        return $this->num_failures;
86    }
87
88    /**
89     * The number of RPCs that failed to record a remote peer.
90     *
91     * Generated from protobuf field <code>int32 num_failures = 2;</code>
92     * @param int $var
93     * @return $this
94     */
95    public function setNumFailures($var)
96    {
97        GPBUtil::checkInt32($var);
98        $this->num_failures = $var;
99
100        return $this;
101    }
102
103    /**
104     * Generated from protobuf field <code>map<string, .grpc.testing.LoadBalancerStatsResponse.RpcsByPeer> rpcs_by_method = 3;</code>
105     * @return \Google\Protobuf\Internal\MapField
106     */
107    public function getRpcsByMethod()
108    {
109        return $this->rpcs_by_method;
110    }
111
112    /**
113     * Generated from protobuf field <code>map<string, .grpc.testing.LoadBalancerStatsResponse.RpcsByPeer> rpcs_by_method = 3;</code>
114     * @param array|\Google\Protobuf\Internal\MapField $var
115     * @return $this
116     */
117    public function setRpcsByMethod($var)
118    {
119        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Grpc\Testing\LoadBalancerStatsResponse\RpcsByPeer::class);
120        $this->rpcs_by_method = $arr;
121
122        return $this;
123    }
124
125}
126
127