Vordel SDK

com.vordel.reporting.rtm.api
Class MetricTypeRangeCount

java.lang.Object
  extended by com.vordel.reporting.rtm.api.MetricType
      extended by com.vordel.reporting.rtm.api.MetricTypeRangeCount

public class MetricTypeRangeCount
extends MetricType

A metric of type MetricTypeRangeCount maintains a set of counters for a set of ranges. An average, minimum and maximum may be calculated for this type of metric. By default this type of metric will be reset at the start of a new time window. The values for each range will be reported at each time window if they are non-zero. A metric of this type is set via a call to the addSample() method on the MetricGroup class. Examples of MetricTypeRangeCount metrics are as follows:


Field Summary
 
Fields inherited from class com.vordel.reporting.rtm.api.MetricType
allowedApiMethods, avgName, maxName, minName, name, resetOnNewTimeWindow, trackCurrentValue
 
Constructor Summary
MetricTypeRangeCount(java.lang.String name)
          Construct a MetricTypeRangeCount.
MetricTypeRangeCount(java.lang.String name, MetricRange[] metricRanges)
          Construct a MetricTypeRangeCount.
MetricTypeRangeCount(java.lang.String name, java.lang.String minName, java.lang.String maxName, java.lang.String avgName, boolean trackCurrentValue, boolean resetOnNewTimeWindow, MetricRange[] metricRanges)
          Construct a MetricTypeRangeCount.
 
Method Summary
 java.lang.String getMetricNameForValue(int value)
          For a particular sample value get the metric name of the range that it falls into.
 java.util.List<java.lang.String> getMetricNames()
          Get the metric names that apply to this MetricTypeRangeCount object.
 MetricRange[] getRanges()
          Get the MetricRange objects associated with this MetricTypeRangeCount.
 void setRanges(MetricRange[] metricRanges)
          Sets the MetricRange objects associated with this MetricTypeRangeCount.
 
Methods inherited from class com.vordel.reporting.rtm.api.MetricType
getAvgName, getMaxName, getMinName, getName, getResetOnNewTimeWindow, getTrackCurrentValue, isAllowedAPIMethod, setAvgName, setMaxName, setMinName, setResetOnNewTimeWindow, setTrackCurrentValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetricTypeRangeCount

public MetricTypeRangeCount(java.lang.String name)
Construct a MetricTypeRangeCount. Field trackCurrentValue defaults to true.

Parameters:
name - The name of the MetricType. This name is used to identify the metric when it is retrieved via the Metrics class, or output to the metrics feed and database.

MetricTypeRangeCount

public MetricTypeRangeCount(java.lang.String name,
                            MetricRange[] metricRanges)
Construct a MetricTypeRangeCount. trackCurrentValue defaults to true.

Parameters:
name - The name of the MetricType. This name is used to identify the metric when it is retrieved via the Metrics class, or output to the metrics feed and database.
metricRanges - The metric ranges.

MetricTypeRangeCount

public MetricTypeRangeCount(java.lang.String name,
                            java.lang.String minName,
                            java.lang.String maxName,
                            java.lang.String avgName,
                            boolean trackCurrentValue,
                            boolean resetOnNewTimeWindow,
                            MetricRange[] metricRanges)
Construct a MetricTypeRangeCount.

Parameters:
name - The name of the metric. This name is used to identify the metric when it is retrieved via the Metrics class, or output to the metrics feed and database if the displayName is null.
minName - The name for the minimum metric. If null, no minimum metric is generated. This name is used to identify the minimum metric when it is retrieved via the Metrics class, or output to the metrics feed and database.
maxName - The name for the maximum metric. If null, no maximum metric is generated. This name is used to identify the maximum metric when it is retrieved via the Metrics class, or output to the metrics feed and database.
avgName - The name for the average metric. If null, no average metric is generated. This name is used to identify the average metric when it is retrieved via the Metrics class, or output to the metrics feed and database.
trackCurrentValue - If true, the current value is tracked, i.e. is output to the metrics feed and database, and available via the Metrics utility methods. In some cases the current value is not really of any use, e.g. cpuUsed as we have cpuUsedAvg, cpuUsedMin and cpuUsedMax for the time window.
resetOnNewTimeWindow - If true, the metric is reset to zero when a new time window starts.
metricRanges - The metric ranges.
Method Detail

getMetricNameForValue

public java.lang.String getMetricNameForValue(int value)
For a particular sample value get the metric name of the range that it falls into. For example take metric respStatRange which maintains a set of counters for HTTP response status codes. It has a range defined for codes < 300 with a related metric name respStatRange2. If the sample value is 200, then the sample falls into the range for respStatRange2, and that name is returned.

Parameters:
value - The sample value
Returns:
The range metric name

setRanges

public void setRanges(MetricRange[] metricRanges)
Sets the MetricRange objects associated with this MetricTypeRangeCount.

Parameters:
The - ranges

getRanges

public MetricRange[] getRanges()
Get the MetricRange objects associated with this MetricTypeRangeCount.

Returns:
The ranges

getMetricNames

public java.util.List<java.lang.String> getMetricNames()
Get the metric names that apply to this MetricTypeRangeCount object. For a MetricTypeRangeCount object, there is a metric name per range in addition to the minimum, maximum and average metric names, (if they are set).

Overrides:
getMetricNames in class MetricType
Returns:
the list of metric names

Vordel SDK


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