Class TimelineMetric
java.lang.Object
org.apache.hadoop.yarn.api.records.timelineservice.TimelineMetric
This class contains the information of a metric that is related to some
entity. Metric can either be a time series or single value.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidstatic TimelineMetricaggregateTo(TimelineMetric incomingMetric, TimelineMetric baseAggregatedMetric) Aggregate an incoming metric to the base aggregated metric with the given operation state in a stateless fashion.static TimelineMetricaggregateTo(TimelineMetric incomingMetric, TimelineMetric baseAggregatedMetric, Map<Object, Object> state) Aggregate an incoming metric to the base aggregated metric with the given operation state.booleangetId()static TimelineMetricGet the latest timeline metric as single value type.Get the real time aggregation operation of this metric.longGet single data timestamp of the metric.Get single data value of the metric.getType()getValuesJAXB()inthashCode()booleanisValid()voidvoidSet the real time aggregation operation of this metric.voidsetType(TimelineMetric.Type metricType) voidtoString()
-
Constructor Details
-
TimelineMetric
public TimelineMetric() -
TimelineMetric
-
-
Method Details
-
getType
-
setType
-
getId
-
setId
-
getRealtimeAggregationOp
Get the real time aggregation operation of this metric.- Returns:
- Real time aggregation operation
-
setRealtimeAggregationOp
Set the real time aggregation operation of this metric.- Parameters:
op- A timeline metric operation that the metric should perform on real time aggregations
-
getValuesJAXB
-
getValues
-
setValues
-
addValues
-
addValue
-
isValid
public boolean isValid() -
hashCode
public int hashCode() -
equals
-
toString
-
getLatestSingleValueMetric
Get the latest timeline metric as single value type.- Parameters:
metric- Incoming timeline metric- Returns:
- The latest metric in the incoming metric
-
getSingleDataTimestamp
public long getSingleDataTimestamp()Get single data timestamp of the metric.- Returns:
- the single data timestamp
-
getSingleDataValue
Get single data value of the metric.- Returns:
- the single data value
-
aggregateTo
public static TimelineMetric aggregateTo(TimelineMetric incomingMetric, TimelineMetric baseAggregatedMetric) Aggregate an incoming metric to the base aggregated metric with the given operation state in a stateless fashion. The assumption here is baseAggregatedMetric and latestMetric should be single value data if not null.- Parameters:
incomingMetric- Incoming timeline metric to aggregatebaseAggregatedMetric- Base timeline metric- Returns:
- Result metric after aggregation
-
aggregateTo
public static TimelineMetric aggregateTo(TimelineMetric incomingMetric, TimelineMetric baseAggregatedMetric, Map<Object, Object> state) Aggregate an incoming metric to the base aggregated metric with the given operation state. The assumption here is baseAggregatedMetric and latestMetric should be single value data if not null.- Parameters:
incomingMetric- Incoming timeline metric to aggregatebaseAggregatedMetric- Base timeline metricstate- Operation state- Returns:
- Result metric after aggregation
-