public class MetricRange
extends java.lang.Object
MetricTypeRangeCount
has a number of ranges
associated with it. For example, for the metric respTimeRange, the following
ranges are defined:- < 10 milliseconds, < 100 < milliseconds, < 1 second,..., >= 60 seconds.
When we add a sample for a metric of this type via MetricGroup.addSample("respTimeRange", 300)
,
the Gateway will determine which range the sample falls into and increment
a counter associated with that range, i.e. respTimeRange1, or respTimeRange2,..
of respTimeRangen etc.
This class defines a range for metric of type MetricTypeRangeCount
.
Ranges are checked in a defined order to ensure that the correct
range is found for a sample.
MetricTypeRangeCount
Modifier and Type | Class and Description |
---|---|
static class |
MetricRange.MetricRangeOperator |
Constructor and Description |
---|
MetricRange(java.lang.String name,
int value,
MetricRange.MetricRangeOperator operator)
Construct a
MetricRange . |
MetricRange(java.lang.String name,
int value,
java.lang.String operator)
Construct a
MetricRange . |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getName()
Get the name of the
MetricRange . |
MetricRange.MetricRangeOperator |
getOperator()
Get the operator.
|
int |
getOperatorOrdinal()
Get the operator's ordinal value.
|
int |
getValue()
Get the value for the range that determines if a sample falls within this
range.
|
boolean |
withinRange(int sample)
Determine if the sample is within this range.
|
public MetricRange(java.lang.String name, int value, MetricRange.MetricRangeOperator operator)
MetricRange
.name
- The name of the MetricRange
, this will be used
as the name of the metric that gets generated for this range,
e.g. respTimeRange1.value
- The value used to determine if a sample is within this range.operator
- The operatorpublic MetricRange(java.lang.String name, int value, java.lang.String operator)
MetricRange
.name
- The name of the MetricRange
, this will be used
as the name of the metric that gets generated for this range,
e.g. respTimeRange1.value
- The value used to determine if a sample is within this range.operator
- The operator as a String, i.e. "<", "<=", ">" or ">=".public java.lang.String getName()
MetricRange
. The name is used
as the name of the metric that gets generated for this range,
e.g. respTimeRange1.public int getValue()
public MetricRange.MetricRangeOperator getOperator()
public int getOperatorOrdinal()
public boolean withinRange(int sample)
sample
- The sample value
This documentation and all its contents and graphics, copyright © 1999 - 2011 Vordel