Class: Google::Apis::Adexchangebuyer2V2beta1::MetricValue

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

Overview

A metric value, with an expected value and a variance; represents a count that may be either exact or estimated (i.e. when sampled).

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) ⇒ MetricValue

Returns a new instance of MetricValue.



2724
2725
2726
# File 'generated/google/apis/adexchangebuyer2_v2beta1/classes.rb', line 2724

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

Instance Attribute Details

#valueFixnum

The expected value of the metric. Corresponds to the JSON property value

Returns:

  • (Fixnum)


2711
2712
2713
# File 'generated/google/apis/adexchangebuyer2_v2beta1/classes.rb', line 2711

def value
  @value
end

#varianceFixnum

The variance (i.e. square of the standard deviation) of the metric value. If value is exact, variance is 0. Can be used to calculate margin of error as a percentage of value, using the following formula, where Z is the standard constant that depends on the desired size of the confidence interval (e.g. for 90% confidence interval, use Z = 1.645): marginOfError = 100 * Z * sqrt(variance) / value Corresponds to the JSON property variance

Returns:

  • (Fixnum)


2722
2723
2724
# File 'generated/google/apis/adexchangebuyer2_v2beta1/classes.rb', line 2722

def variance
  @variance
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



2729
2730
2731
2732
# File 'generated/google/apis/adexchangebuyer2_v2beta1/classes.rb', line 2729

def update!(**args)
  @value = args[:value] if args.key?(:value)
  @variance = args[:variance] if args.key?(:variance)
end