Vordel SDK

com.vordel.reporting.rtm.api
Class MetricType

java.lang.Object
  extended by com.vordel.reporting.rtm.api.MetricType
Direct Known Subclasses:
MetricTypeRangeCount, MetricTypeValue

public abstract class MetricType
extends java.lang.Object

The base abstract class for a metric type. A MetricGroupType has a set of concrete MetricTypes associated with it. The list below describes the various types of concrete MetricTypes. See Javadoc for the concrete classes for more information on the different metric types supported.

A time window is the time period for which the Gateway gathers metrics before writing the values to the database, and resetting for the next time window. By default metrics are reset to zero at the start of a new time window. MetricTypes may be created to not reset at the start of a new time window by setting the resetOnNewTimeWindow flag to be false. This should be set to false for metrics which should not be set to zero just because a new time window has begun, e.g. systemCpuAvg. Note that a MetricType value is always reset when a new value is passed to it on a new time window. A resetOnNewTimeWindow value of false will maintain the value from the previous time window if no values are passed to the MetricType for the current time window.


Field Summary
protected  java.util.List<java.lang.String> allowedApiMethods
          Internal.
protected  java.lang.String avgName
          The name for the average metric.
protected  java.lang.String maxName
          The name for the maximum metric.
protected  java.lang.String minName
          The name for the minimum metric.
protected  java.lang.String name
          The name of the MetricType.
protected  boolean resetOnNewTimeWindow
          If true, the value is reset to zero on a new time window.
protected  boolean trackCurrentValue
          If true, the current value is tracked, so it is output to the metrics feed and database, and available via the Metrics utility methods.
 
Constructor Summary
MetricType(java.lang.String name)
          Construct a MetricType.
MetricType(java.lang.String name, java.lang.String minName, java.lang.String maxName, java.lang.String avgName, boolean trackCurrentValue, boolean resetOnNewTimeWindow)
          Construct a MetricTypeValue.
 
Method Summary
 java.lang.String getAvgName()
          Get the metric name for the average metric.
 java.lang.String getMaxName()
          Get the metric name for the maximum metric.
 java.util.List<java.lang.String> getMetricNames()
          Get the metric names that apply to this MetricType object.
 java.lang.String getMinName()
          Get the metric name for the minimum metric.
 java.lang.String getName()
          Get the metric name.
 boolean getResetOnNewTimeWindow()
          Get the flag value which determines if the current value is reset when the time window changes.
 boolean getTrackCurrentValue()
          Get the flag value which determines if the current value is tracked.
 boolean isAllowedAPIMethod(java.lang.String methodName)
          Internal method.
 void setAvgName(java.lang.String name)
          Set the metric name for the average metric.
 void setMaxName(java.lang.String name)
          Set the metric name for the maximum metric.
 void setMinName(java.lang.String name)
          Set the metric name for the minimum metric.
 void setResetOnNewTimeWindow(boolean resetOnNewTimeWindow)
          Set the flag to determine if the metric is reset to zero at the start of a new time window.
 void setTrackCurrentValue(boolean trackCurrentValue)
          Set the flag to determine if the current value is tracked.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected java.lang.String 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.


allowedApiMethods

protected java.util.List<java.lang.String> allowedApiMethods
Internal.


minName

protected java.lang.String 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

protected java.lang.String 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

protected java.lang.String 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

protected boolean trackCurrentValue
If true, the current value is tracked, so it 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. This defaults to true.


resetOnNewTimeWindow

protected boolean resetOnNewTimeWindow
If true, the value is reset to zero on a new time window. For some metrics it does not make sense to reset the value to zero. For example, if a metric is tracking the used CPU percentage, it does not make sense to reset this metric to zero on a new time window as the CPU percentage is not necessarily zero. If a metric is counting the number of messages, then it does make sense to reset the metric to zero at the start of a time window as we need to start counting again. This defaults to true.

Constructor Detail

MetricType

public MetricType(java.lang.String name)
Construct a MetricType.

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.

MetricType

public MetricType(java.lang.String name,
                  java.lang.String minName,
                  java.lang.String maxName,
                  java.lang.String avgName,
                  boolean trackCurrentValue,
                  boolean resetOnNewTimeWindow)
Construct a MetricTypeValue.

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.
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. This is enough information.
resetOnNewTimeWindow - If true, the metric is reset to zero when a new time window starts.
Method Detail

getName

public java.lang.String getName()
Get the metric name.

Returns:
the name

setMinName

public void setMinName(java.lang.String name)
Set the metric 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.

Parameters:
name - the metric name

setMaxName

public void setMaxName(java.lang.String name)
Set the metric name for the maximum metric. If null, no minimum 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.

Parameters:
name - the metric name

setAvgName

public void setAvgName(java.lang.String name)
Set the metric name for the average metric. If null, no minimum 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.

Parameters:
name - the metric name

setTrackCurrentValue

public void setTrackCurrentValue(boolean trackCurrentValue)
Set the flag to determine if the current value is tracked. 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.

Parameters:
trackCurrentValue - flag value

setResetOnNewTimeWindow

public void setResetOnNewTimeWindow(boolean resetOnNewTimeWindow)
Set the flag to determine if the metric is reset to zero at the start of a new time window. See class Javadoc for more information on time windows.

Parameters:
trackCurrentValue - flag value

getMinName

public java.lang.String getMinName()
Get the metric 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.

Returns:
name the metric name

getMaxName

public java.lang.String getMaxName()
Get the metric 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.

Returns:
name the metric name

getAvgName

public java.lang.String getAvgName()
Get the metric 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.

Returns:
name the metric name

getTrackCurrentValue

public boolean getTrackCurrentValue()
Get the flag value which determines if the current value is tracked. 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. This is enough information.

Returns:
trackCurrentValue flag value

getResetOnNewTimeWindow

public boolean getResetOnNewTimeWindow()
Get the flag value which determines if the current value is reset when the time window changes.

Returns:
resetOnNewTimeWindow flag value

getMetricNames

public java.util.List<java.lang.String> getMetricNames()
Get the metric names that apply to this MetricType object. For a MetricTypeValue object, there is a metric name for the current value (if trackCurrentValue is true), along with a metric name for the minimum, maximum and average (if they are configured).

Returns:
the list of metric names

isAllowedAPIMethod

public boolean isAllowedAPIMethod(java.lang.String methodName)
Internal method.

Parameters:
methodName -
Returns:

Vordel SDK


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