Class: Google::Apis::AnalyticsdataV1alpha::Metric

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

Overview

The quantitative measurements of a report. For example, the metric eventCount is the total number of events. Requests are allowed up to 10 metrics.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Metric

Returns a new instance of Metric.



785
786
787
# File 'generated/google/apis/analyticsdata_v1alpha/classes.rb', line 785

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

Instance Attribute Details

#expressionString

A mathematical expression for derived metrics. For example, the metric Event count per user is eventCount/totalUsers. Corresponds to the JSON property expression

Returns:

  • (String)


765
766
767
# File 'generated/google/apis/analyticsdata_v1alpha/classes.rb', line 765

def expression
  @expression
end

#invisibleBoolean Also known as: invisible?

Indicates if a metric is invisible in the report response. If a metric is invisible, the metric will not produce a column in the response, but can be used in metricFilter, orderBys, or a metric expression. Corresponds to the JSON property invisible

Returns:

  • (Boolean)


772
773
774
# File 'generated/google/apis/analyticsdata_v1alpha/classes.rb', line 772

def invisible
  @invisible
end

#nameString

The name of the metric. See the API Metrics for the list of metric names. If expression is specified, name can be any string that you would like. For example if expression is screenPageViews/sessions, you could call that metric's name = viewsPerSession. Metrics are referenced by name in metricFilter, orderBys, and metric expression. Corresponds to the JSON property name

Returns:

  • (String)


783
784
785
# File 'generated/google/apis/analyticsdata_v1alpha/classes.rb', line 783

def name
  @name
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



790
791
792
793
794
# File 'generated/google/apis/analyticsdata_v1alpha/classes.rb', line 790

def update!(**args)
  @expression = args[:expression] if args.key?(:expression)
  @invisible = args[:invisible] if args.key?(:invisible)
  @name = args[:name] if args.key?(:name)
end