Vordel SDK

com.vordel.reporting.rtm.api
Class MetricRange

java.lang.Object
  extended by com.vordel.reporting.rtm.api.MetricRange

public class MetricRange
extends java.lang.Object

A metric of type 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.

See Also:
MetricTypeRangeCount

Nested Class Summary
static class MetricRange.MetricRangeOperator
           
 
Constructor Summary
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.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetricRange

public MetricRange(java.lang.String name,
                   int value,
                   MetricRange.MetricRangeOperator operator)
Construct a MetricRange.

Parameters:
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

MetricRange

public MetricRange(java.lang.String name,
                   int value,
                   java.lang.String operator)
Construct a MetricRange.

Parameters:
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 ">=".
Method Detail

getName

public java.lang.String getName()
Get the name of the MetricRange. The name is used as the name of the metric that gets generated for this range, e.g. respTimeRange1.

Returns:
The range name.

getValue

public int getValue()
Get the value for the range that determines if a sample falls within this range.

Returns:
The range value

getOperator

public MetricRange.MetricRangeOperator getOperator()
Get the operator.

Returns:
The operator

getOperatorOrdinal

public int getOperatorOrdinal()
Get the operator's ordinal value.

Returns:
The operator

withinRange

public boolean withinRange(int sample)
Determine if the sample is within this range.

Parameters:
sample - The sample value
Returns:
true if within range

Vordel SDK


This documentation and all its contents and graphics, copyright © 1999 - 2011 Vordel