public interface ApiMetricName extends FieldName
Metric names are used as the keys in the metric dictionary and are also used in the query api to select logical metrics.
Modifier and Type | Method and Description |
---|---|
String |
getApiName()
The API Name is the external, end-user-facing name for the metric.
|
default boolean |
isValidFor(Granularity granularity)
Determine if this API Metric Name is valid for the given time grain.
|
default boolean |
isValidFor(Granularity granularity,
LogicalMetric logicalMetric)
Determine if this API Metric Name is valid for the given time grain.
|
boolean |
isValidFor(TimeGrain grain)
Determine if this API Metric Name is valid for the given time grain.
|
static ApiMetricName |
of(String name)
Wrap a string in an anonymous instance of ApiMetricName.
|
boolean isValidFor(TimeGrain grain)
An example of this is a DailyAverage metric than doesn't make sense at the Day grain, but does at the Week.
grain
- TimeGrain to determine validity fordefault boolean isValidFor(Granularity granularity)
This version only takes the time grain into account. The default implementation simply sets a required minimum grain for the metric.
An example of this is a DailyAverage metric that doesn't make sense to query by the HOUR grain, but does at WEEK.
granularity
- TimeGrain to determine validity fordefault boolean isValidFor(Granularity granularity, LogicalMetric logicalMetric)
An example of this is a DailyAverage metric that doesn't make sense to query by the HOUR grain, but does at WEEK.
granularity
- TimeGrain to determine validity forlogicalMetric
- The metric whose validity is being tested.String getApiName()
static ApiMetricName of(String name)
name
- the name being wrappedCopyright © 2016–2018 Yahoo! Inc.. All rights reserved.