public class FilteringMetricsScope extends AccumulateByNameMetricsScope
IMetricsScope
that filters addData(java.lang.String, double, software.amazon.awssdk.services.cloudwatch.model.StandardUnit)
calls based on the provided metrics level. If the provided
metrics level is less than enabled level, then data is dropped. This class also adds the dimension to the scope
if it is enabled.data
METRICS_DIMENSIONS_ALL
Constructor and Description |
---|
FilteringMetricsScope()
Creates a metrics scope that allows all metrics data and dimensions.
|
FilteringMetricsScope(MetricsLevel metricsLevel,
Set<String> metricsEnabledDimensions)
Creates a metrics scope that drops data with level below the given enabled level and only allows dimensions
that are part of the given enabled dimensions list.
|
Modifier and Type | Method and Description |
---|---|
void |
addData(String name,
double value,
software.amazon.awssdk.services.cloudwatch.model.StandardUnit unit)
Adds the data to the metrics scope at lowest metrics level.
|
void |
addData(String name,
double value,
software.amazon.awssdk.services.cloudwatch.model.StandardUnit unit,
MetricsLevel level)
Adds the data to the metrics scope if the given level is equal to above the enabled metrics
level.
|
void |
addDimension(String name,
String value)
Adds given dimension with value if allowed dimensions list contains this dimension's name.
|
getKey
addData
end
getDimensions
public FilteringMetricsScope()
public FilteringMetricsScope(MetricsLevel metricsLevel, Set<String> metricsEnabledDimensions)
metricsLevel
- Level of metrics that is enabled. All metrics below this level will be dropped.metricsEnabledDimensions
- Enabled dimensions.public void addData(String name, double value, software.amazon.awssdk.services.cloudwatch.model.StandardUnit unit)
addData
in interface MetricsScope
addData
in class AccumulatingMetricsScope<String>
name
- Metrics data name.value
- Value of the metrics.unit
- Unit of the metrics.public void addData(String name, double value, software.amazon.awssdk.services.cloudwatch.model.StandardUnit unit, MetricsLevel level)
addData
in interface MetricsScope
addData
in class AccumulatingMetricsScope<String>
name
- Metrics data name.value
- Value of the metrics.unit
- Unit of the metrics.level
- Metrics level for the data.public void addDimension(String name, String value)
addDimension
in interface MetricsScope
addDimension
in class EndingMetricsScope
name
- Name of the dimension.value
- Value for the dimension.Copyright © 2021. All rights reserved.