Class: Google::Apis::ServicecontrolV1::Distribution

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/servicecontrol_v1/classes.rb,
lib/google/apis/servicecontrol_v1/representations.rb,
lib/google/apis/servicecontrol_v1/representations.rb

Overview

Distribution represents a frequency distribution of double-valued sample points. It contains the size of the population of sample points plus additional optional information: * the arithmetic mean of the samples * the minimum and maximum of the samples * the sum-squared-deviation of the samples, used to compute variance * a histogram of the values of the sample points

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Distribution

Returns a new instance of Distribution.



765
766
767
# File 'lib/google/apis/servicecontrol_v1/classes.rb', line 765

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#bucket_countsArray<Fixnum>

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_optionbelow for more details. Any suffix of trailing zeros may be omitted. Corresponds to the JSON propertybucketCounts`

Returns:

  • (Array<Fixnum>)


715
716
717
# File 'lib/google/apis/servicecontrol_v1/classes.rb', line 715

def bucket_counts
  @bucket_counts
end

#countFixnum

The total number of samples in the distribution. Must be >= 0. Corresponds to the JSON property count

Returns:

  • (Fixnum)


720
721
722
# File 'lib/google/apis/servicecontrol_v1/classes.rb', line 720

def count
  @count
end

#exemplarsArray<Google::Apis::ServicecontrolV1::Exemplar>

Example points. Must be in increasing order of value field. Corresponds to the JSON property exemplars



725
726
727
# File 'lib/google/apis/servicecontrol_v1/classes.rb', line 725

def exemplars
  @exemplars
end

#explicit_bucketsGoogle::Apis::ServicecontrolV1::ExplicitBuckets

Describing buckets with arbitrary user-provided width. Corresponds to the JSON property explicitBuckets



730
731
732
# File 'lib/google/apis/servicecontrol_v1/classes.rb', line 730

def explicit_buckets
  @explicit_buckets
end

#exponential_bucketsGoogle::Apis::ServicecontrolV1::ExponentialBuckets

Describing buckets with exponentially growing width. Corresponds to the JSON property exponentialBuckets



735
736
737
# File 'lib/google/apis/servicecontrol_v1/classes.rb', line 735

def exponential_buckets
  @exponential_buckets
end

#linear_bucketsGoogle::Apis::ServicecontrolV1::LinearBuckets

Describing buckets with constant width. Corresponds to the JSON property linearBuckets



740
741
742
# File 'lib/google/apis/servicecontrol_v1/classes.rb', line 740

def linear_buckets
  @linear_buckets
end

#maximumFloat

The maximum of the population of values. Ignored if count is zero. Corresponds to the JSON property maximum

Returns:

  • (Float)


745
746
747
# File 'lib/google/apis/servicecontrol_v1/classes.rb', line 745

def maximum
  @maximum
end

#meanFloat

The arithmetic mean of the samples in the distribution. If count is zero then this field must be zero. Corresponds to the JSON property mean

Returns:

  • (Float)


751
752
753
# File 'lib/google/apis/servicecontrol_v1/classes.rb', line 751

def mean
  @mean
end

#minimumFloat

The minimum of the population of values. Ignored if count is zero. Corresponds to the JSON property minimum

Returns:

  • (Float)


756
757
758
# File 'lib/google/apis/servicecontrol_v1/classes.rb', line 756

def minimum
  @minimum
end

#sum_of_squared_deviationFloat

The sum of squared deviations from the mean: Sumi=1..count where each x_i is a sample values. If count is zero then this field must be zero, otherwise validation of the request fails. Corresponds to the JSON property sumOfSquaredDeviation

Returns:

  • (Float)


763
764
765
# File 'lib/google/apis/servicecontrol_v1/classes.rb', line 763

def sum_of_squared_deviation
  @sum_of_squared_deviation
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



770
771
772
773
774
775
776
777
778
779
780
781
# File 'lib/google/apis/servicecontrol_v1/classes.rb', line 770

def update!(**args)
  @bucket_counts = args[:bucket_counts] if args.key?(:bucket_counts)
  @count = args[:count] if args.key?(:count)
  @exemplars = args[:exemplars] if args.key?(:exemplars)
  @explicit_buckets = args[:explicit_buckets] if args.key?(:explicit_buckets)
  @exponential_buckets = args[:exponential_buckets] if args.key?(:exponential_buckets)
  @linear_buckets = args[:linear_buckets] if args.key?(:linear_buckets)
  @maximum = args[:maximum] if args.key?(:maximum)
  @mean = args[:mean] if args.key?(:mean)
  @minimum = args[:minimum] if args.key?(:minimum)
  @sum_of_squared_deviation = args[:sum_of_squared_deviation] if args.key?(:sum_of_squared_deviation)
end