Class: Google::Apis::ChromeuxreportV1::Metric

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

Overview

A metric is a set of user experience data for a single web performance metric, like "first contentful paint". It contains a summary histogram of real world Chrome usage as a series of bins.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Metric

Returns a new instance of Metric.



312
313
314
# File 'lib/google/apis/chromeuxreport_v1/classes.rb', line 312

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

Instance Attribute Details

#fractionsHash<String,Float>

For enum metrics, provides fractions which add up to approximately 1.0. Corresponds to the JSON property fractions

Returns:

  • (Hash<String,Float>)


297
298
299
# File 'lib/google/apis/chromeuxreport_v1/classes.rb', line 297

def fractions
  @fractions
end

#histogramArray<Google::Apis::ChromeuxreportV1::Bin>

The histogram of user experiences for a metric. The histogram will have at least one bin and the densities of all bins will add up to ~1. Corresponds to the JSON property histogram



303
304
305
# File 'lib/google/apis/chromeuxreport_v1/classes.rb', line 303

def histogram
  @histogram
end

#percentilesGoogle::Apis::ChromeuxreportV1::Percentiles

Percentiles contains synthetic values of a metric at a given statistical percentile. These are used for estimating a metric's value as experienced by a percentage of users out of the total number of users. Corresponds to the JSON property percentiles



310
311
312
# File 'lib/google/apis/chromeuxreport_v1/classes.rb', line 310

def percentiles
  @percentiles
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



317
318
319
320
321
# File 'lib/google/apis/chromeuxreport_v1/classes.rb', line 317

def update!(**args)
  @fractions = args[:fractions] if args.key?(:fractions)
  @histogram = args[:histogram] if args.key?(:histogram)
  @percentiles = args[:percentiles] if args.key?(:percentiles)
end