pub struct Metric {
pub expression: Option<String>,
pub invisible: Option<bool>,
pub name: Option<String>,
}
Expand description
The quantitative measurements of a report. For example, the metric eventCount
is the total number of events. Requests are allowed up to 10 metrics.
This type is not used in any activity, and only used as part of another schema.
Fields§
§expression: Option<String>
A mathematical expression for derived metrics. For example, the metric Event count per user is eventCount/totalUsers
.
invisible: Option<bool>
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
.
name: Option<String>
The name of the metric. See the API Metrics for the list of metric names supported by core reporting methods such as runReport
and batchRunReports
. See Realtime Metrics for the list of metric names supported by the runRealtimeReport
method. See Funnel Metrics for the list of metric names supported by the runFunnelReport
method. If expression
is specified, name
can be any string that you would like within the allowed character set. For example if expression
is screenPageViews/sessions
, you could call that metric’s name = viewsPerSession
. Metric names that you choose must match the regular expression ^[a-zA-Z0-9_]$
. Metrics are referenced by name
in metricFilter
, orderBys
, and metric expression
.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Metric
impl<'de> Deserialize<'de> for Metric
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Part for Metric
Auto Trait Implementations§
impl Freeze for Metric
impl RefUnwindSafe for Metric
impl Send for Metric
impl Sync for Metric
impl Unpin for Metric
impl UnwindSafe for Metric
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more