KeyType
- can be a class or object defined by the user that stores information about a MetricDatum needed
by the user.
The following is a example of what a KeyType class might look like:
class SampleKeyType {
private long timeKeyCreated;
private MetricDatum datum;
public SampleKeyType(long timeKeyCreated, MetricDatum datum){
this.timeKeyCreated = timeKeyCreated;
this.datum = datum;
}
}public abstract class AccumulatingMetricsScope<KeyType> extends EndingMetricsScope
Modifier and Type | Field and Description |
---|---|
protected Map<KeyType,software.amazon.awssdk.services.cloudwatch.model.MetricDatum> |
data |
METRICS_DIMENSIONS_ALL
Constructor and Description |
---|
AccumulatingMetricsScope() |
Modifier and Type | Method and Description |
---|---|
void |
addData(KeyType key,
String name,
double value,
software.amazon.awssdk.services.cloudwatch.model.StandardUnit unit)
Adds data points to an IMetricsScope.
|
void |
addData(String name,
double value,
software.amazon.awssdk.services.cloudwatch.model.StandardUnit unit)
Adds a data point to this IMetricsScope.
|
void |
addData(String name,
double value,
software.amazon.awssdk.services.cloudwatch.model.StandardUnit unit,
MetricsLevel level)
Adds a data point to this IMetricsScope if given metrics level is enabled.
|
protected abstract KeyType |
getKey(String name) |
addDimension, end
getDimensions
public void addData(String name, double value, software.amazon.awssdk.services.cloudwatch.model.StandardUnit unit)
MetricsScope
addData
in interface MetricsScope
addData
in class EndingMetricsScope
name
- data point namevalue
- data point valueunit
- unit of data pointpublic void addData(String name, double value, software.amazon.awssdk.services.cloudwatch.model.StandardUnit unit, MetricsLevel level)
MetricsScope
addData
in interface MetricsScope
addData
in class EndingMetricsScope
name
- data point namevalue
- data point valueunit
- unit of data pointlevel
- metrics level of this data pointprotected abstract KeyType getKey(String name)
name
- key name for a metricpublic void addData(KeyType key, String name, double value, software.amazon.awssdk.services.cloudwatch.model.StandardUnit unit)
key
- data point keyname
- data point namevalue
- data point valueunit
- data point unitCopyright © 2021. All rights reserved.