Class: Google::Apis::MonitoringV3::BucketOptions

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

Overview

A Distribution may optionally contain a histogram of the values in the population. The histogram is given in bucket_counts as counts of values that fall into one of a sequence of non-overlapping buckets. The sequence of buckets is described by bucket_options.A bucket specifies an inclusive lower bound and exclusive upper bound for the values that are counted for that bucket. The upper bound of a bucket is strictly greater than the lower bound. The sequence of N buckets for a Distribution consists of an underflow bucket ( number 0), zero or more finite buckets (number 1 through N - 2) and an overflow bucket (number N - 1). The buckets are contiguous: the lower bound of bucket i (i > 0) is the same as the upper bound of bucket i - 1. The buckets span the whole range of finite values: lower bound of the underflow bucket is -infinity and the upper bound of the overflow bucket is +infinity. The finite buckets are so-called because both bounds are finite.BucketOptions describes bucket boundaries in one of three ways. Two describe the boundaries by giving parameters for a formula to generate boundaries and one gives the bucket boundaries explicitly.If bucket_options is not given, then no bucket_counts may be given.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ BucketOptions

Returns a new instance of BucketOptions.



1199
1200
1201
# File 'generated/google/apis/monitoring_v3/classes.rb', line 1199

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

Instance Attribute Details

#explicit_bucketsGoogle::Apis::MonitoringV3::Explicit

A set of buckets with arbitrary widths.Defines size(bounds) + 1 (= N) buckets with these boundaries for bucket i:Upper bound (0 <= i < N-1): boundsi Lower bound (1 <= i < N); boundsi - 1There must be at least one element in bounds. If bounds has only one element, there are no finite buckets, and that single element is the common boundary of the overflow and underflow buckets. Corresponds to the JSON property explicitBuckets



1178
1179
1180
# File 'generated/google/apis/monitoring_v3/classes.rb', line 1178

def explicit_buckets
  @explicit_buckets
end

#exponential_bucketsGoogle::Apis::MonitoringV3::Exponential

Specify a sequence of buckets that have a width that is proportional to the value of the lower bound. Each bucket represents a constant relative uncertainty on a specific value in the bucket.Defines num_finite_buckets + 2 (= N) buckets with these boundaries for bucket i:Upper bound (0 <= i < N-1) : scale * (growth_factor ^ i). Lower bound (1 <= i < N): scale * ( growth_factor ^ (i - 1)). Corresponds to the JSON property exponentialBuckets



1188
1189
1190
# File 'generated/google/apis/monitoring_v3/classes.rb', line 1188

def exponential_buckets
  @exponential_buckets
end

#linear_bucketsGoogle::Apis::MonitoringV3::Linear

Specify a sequence of buckets that all have the same width (except overflow and underflow). Each bucket represents a constant absolute uncertainty on the specific value in the bucket.Defines num_finite_buckets + 2 (= N) buckets with these boundaries for bucket i:Upper bound (0 <= i < N-1): offset + ( width * i). Lower bound (1 <= i < N): offset + (width * (i - 1)). Corresponds to the JSON property linearBuckets



1197
1198
1199
# File 'generated/google/apis/monitoring_v3/classes.rb', line 1197

def linear_buckets
  @linear_buckets
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1204
1205
1206
1207
1208
# File 'generated/google/apis/monitoring_v3/classes.rb', line 1204

def update!(**args)
  @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)
end