google.api.servicecontrol.v1.Distribution
*/
class Distribution extends \Google\Protobuf\Internal\Message
{
/**
* The total number of samples in the distribution. Must be >= 0.
*
* Generated from protobuf field int64 count = 1;
*/
private $count = 0;
/**
* The arithmetic mean of the samples in the distribution. If `count` is
* zero then this field must be zero.
*
* Generated from protobuf field double mean = 2;
*/
private $mean = 0.0;
/**
* The minimum of the population of values. Ignored if `count` is zero.
*
* Generated from protobuf field double minimum = 3;
*/
private $minimum = 0.0;
/**
* The maximum of the population of values. Ignored if `count` is zero.
*
* Generated from protobuf field double maximum = 4;
*/
private $maximum = 0.0;
/**
* The sum of squared deviations from the mean:
* Sum[i=1..count]((x_i - mean)^2)
* where each x_i is a sample values. If `count` is zero then this field
* must be zero, otherwise validation of the request fails.
*
* Generated from protobuf field double sum_of_squared_deviation = 5;
*/
private $sum_of_squared_deviation = 0.0;
/**
* The number of samples in each histogram bucket. `bucket_counts` are
* optional. If present, they must sum to the `count` value.
* The buckets are defined below in `bucket_option`. There are N buckets.
* `bucket_counts[0]` is the number of samples in the underflow bucket.
* `bucket_counts[1]` to `bucket_counts[N-1]` are the numbers of samples
* in each of the finite buckets. And `bucket_counts[N] is the number
* of samples in the overflow bucket. See the comments of `bucket_option`
* below for more details.
* Any suffix of trailing zeros may be omitted.
*
* Generated from protobuf field repeated int64 bucket_counts = 6;
*/
private $bucket_counts;
protected $bucket_option;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type int|string $count
* The total number of samples in the distribution. Must be >= 0.
* @type float $mean
* The arithmetic mean of the samples in the distribution. If `count` is
* zero then this field must be zero.
* @type float $minimum
* The minimum of the population of values. Ignored if `count` is zero.
* @type float $maximum
* The maximum of the population of values. Ignored if `count` is zero.
* @type float $sum_of_squared_deviation
* The sum of squared deviations from the mean:
* Sum[i=1..count]((x_i - mean)^2)
* where each x_i is a sample values. If `count` is zero then this field
* must be zero, otherwise validation of the request fails.
* @type int[]|string[]|\Google\Protobuf\Internal\RepeatedField $bucket_counts
* The number of samples in each histogram bucket. `bucket_counts` are
* optional. If present, they must sum to the `count` value.
* The buckets are defined below in `bucket_option`. There are N buckets.
* `bucket_counts[0]` is the number of samples in the underflow bucket.
* `bucket_counts[1]` to `bucket_counts[N-1]` are the numbers of samples
* in each of the finite buckets. And `bucket_counts[N] is the number
* of samples in the overflow bucket. See the comments of `bucket_option`
* below for more details.
* Any suffix of trailing zeros may be omitted.
* @type \Google\Api\Servicecontrol\V1\Distribution\LinearBuckets $linear_buckets
* Buckets with constant width.
* @type \Google\Api\Servicecontrol\V1\Distribution\ExponentialBuckets $exponential_buckets
* Buckets with exponentially growing width.
* @type \Google\Api\Servicecontrol\V1\Distribution\ExplicitBuckets $explicit_buckets
* Buckets with arbitrary user-provided width.
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Google\Api\Servicecontrol\V1\Distribution::initOnce();
parent::__construct($data);
}
/**
* The total number of samples in the distribution. Must be >= 0.
*
* Generated from protobuf field int64 count = 1;
* @return int|string
*/
public function getCount()
{
return $this->count;
}
/**
* The total number of samples in the distribution. Must be >= 0.
*
* Generated from protobuf field int64 count = 1;
* @param int|string $var
* @return $this
*/
public function setCount($var)
{
GPBUtil::checkInt64($var);
$this->count = $var;
return $this;
}
/**
* The arithmetic mean of the samples in the distribution. If `count` is
* zero then this field must be zero.
*
* Generated from protobuf field double mean = 2;
* @return float
*/
public function getMean()
{
return $this->mean;
}
/**
* The arithmetic mean of the samples in the distribution. If `count` is
* zero then this field must be zero.
*
* Generated from protobuf field double mean = 2;
* @param float $var
* @return $this
*/
public function setMean($var)
{
GPBUtil::checkDouble($var);
$this->mean = $var;
return $this;
}
/**
* The minimum of the population of values. Ignored if `count` is zero.
*
* Generated from protobuf field double minimum = 3;
* @return float
*/
public function getMinimum()
{
return $this->minimum;
}
/**
* The minimum of the population of values. Ignored if `count` is zero.
*
* Generated from protobuf field double minimum = 3;
* @param float $var
* @return $this
*/
public function setMinimum($var)
{
GPBUtil::checkDouble($var);
$this->minimum = $var;
return $this;
}
/**
* The maximum of the population of values. Ignored if `count` is zero.
*
* Generated from protobuf field double maximum = 4;
* @return float
*/
public function getMaximum()
{
return $this->maximum;
}
/**
* The maximum of the population of values. Ignored if `count` is zero.
*
* Generated from protobuf field double maximum = 4;
* @param float $var
* @return $this
*/
public function setMaximum($var)
{
GPBUtil::checkDouble($var);
$this->maximum = $var;
return $this;
}
/**
* The sum of squared deviations from the mean:
* Sum[i=1..count]((x_i - mean)^2)
* where each x_i is a sample values. If `count` is zero then this field
* must be zero, otherwise validation of the request fails.
*
* Generated from protobuf field double sum_of_squared_deviation = 5;
* @return float
*/
public function getSumOfSquaredDeviation()
{
return $this->sum_of_squared_deviation;
}
/**
* The sum of squared deviations from the mean:
* Sum[i=1..count]((x_i - mean)^2)
* where each x_i is a sample values. If `count` is zero then this field
* must be zero, otherwise validation of the request fails.
*
* Generated from protobuf field double sum_of_squared_deviation = 5;
* @param float $var
* @return $this
*/
public function setSumOfSquaredDeviation($var)
{
GPBUtil::checkDouble($var);
$this->sum_of_squared_deviation = $var;
return $this;
}
/**
* The number of samples in each histogram bucket. `bucket_counts` are
* optional. If present, they must sum to the `count` value.
* The buckets are defined below in `bucket_option`. There are N buckets.
* `bucket_counts[0]` is the number of samples in the underflow bucket.
* `bucket_counts[1]` to `bucket_counts[N-1]` are the numbers of samples
* in each of the finite buckets. And `bucket_counts[N] is the number
* of samples in the overflow bucket. See the comments of `bucket_option`
* below for more details.
* Any suffix of trailing zeros may be omitted.
*
* Generated from protobuf field repeated int64 bucket_counts = 6;
* @return \Google\Protobuf\Internal\RepeatedField
*/
public function getBucketCounts()
{
return $this->bucket_counts;
}
/**
* The number of samples in each histogram bucket. `bucket_counts` are
* optional. If present, they must sum to the `count` value.
* The buckets are defined below in `bucket_option`. There are N buckets.
* `bucket_counts[0]` is the number of samples in the underflow bucket.
* `bucket_counts[1]` to `bucket_counts[N-1]` are the numbers of samples
* in each of the finite buckets. And `bucket_counts[N] is the number
* of samples in the overflow bucket. See the comments of `bucket_option`
* below for more details.
* Any suffix of trailing zeros may be omitted.
*
* Generated from protobuf field repeated int64 bucket_counts = 6;
* @param int[]|string[]|\Google\Protobuf\Internal\RepeatedField $var
* @return $this
*/
public function setBucketCounts($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT64);
$this->bucket_counts = $arr;
return $this;
}
/**
* Buckets with constant width.
*
* Generated from protobuf field .google.api.servicecontrol.v1.Distribution.LinearBuckets linear_buckets = 7;
* @return \Google\Api\Servicecontrol\V1\Distribution\LinearBuckets
*/
public function getLinearBuckets()
{
return $this->readOneof(7);
}
/**
* Buckets with constant width.
*
* Generated from protobuf field .google.api.servicecontrol.v1.Distribution.LinearBuckets linear_buckets = 7;
* @param \Google\Api\Servicecontrol\V1\Distribution\LinearBuckets $var
* @return $this
*/
public function setLinearBuckets($var)
{
GPBUtil::checkMessage($var, \Google\Api\Servicecontrol\V1\Distribution_LinearBuckets::class);
$this->writeOneof(7, $var);
return $this;
}
/**
* Buckets with exponentially growing width.
*
* Generated from protobuf field .google.api.servicecontrol.v1.Distribution.ExponentialBuckets exponential_buckets = 8;
* @return \Google\Api\Servicecontrol\V1\Distribution\ExponentialBuckets
*/
public function getExponentialBuckets()
{
return $this->readOneof(8);
}
/**
* Buckets with exponentially growing width.
*
* Generated from protobuf field .google.api.servicecontrol.v1.Distribution.ExponentialBuckets exponential_buckets = 8;
* @param \Google\Api\Servicecontrol\V1\Distribution\ExponentialBuckets $var
* @return $this
*/
public function setExponentialBuckets($var)
{
GPBUtil::checkMessage($var, \Google\Api\Servicecontrol\V1\Distribution_ExponentialBuckets::class);
$this->writeOneof(8, $var);
return $this;
}
/**
* Buckets with arbitrary user-provided width.
*
* Generated from protobuf field .google.api.servicecontrol.v1.Distribution.ExplicitBuckets explicit_buckets = 9;
* @return \Google\Api\Servicecontrol\V1\Distribution\ExplicitBuckets
*/
public function getExplicitBuckets()
{
return $this->readOneof(9);
}
/**
* Buckets with arbitrary user-provided width.
*
* Generated from protobuf field .google.api.servicecontrol.v1.Distribution.ExplicitBuckets explicit_buckets = 9;
* @param \Google\Api\Servicecontrol\V1\Distribution\ExplicitBuckets $var
* @return $this
*/
public function setExplicitBuckets($var)
{
GPBUtil::checkMessage($var, \Google\Api\Servicecontrol\V1\Distribution_ExplicitBuckets::class);
$this->writeOneof(9, $var);
return $this;
}
/**
* @return string
*/
public function getBucketOption()
{
return $this->whichOneof("bucket_option");
}
}