public class Metrics extends CloneableDataObject implements MetricsConfiguration
Title: Open Service Framework
Description: The Metrics Registry
is a structure that holds definitions for Service metrics.
Copyright: Copyright (c) 2009
Company: StreamScape Technologies
DEFAULT_SERIAL_VERSION_ID
Constructor and Description |
---|
Metrics() |
Modifier and Type | Method and Description |
---|---|
void |
addMetric(MetricDefinition metric)
This method adds a
Metric to the Service Configuration. |
java.lang.Object |
clone()
Clones the object.
|
boolean |
existsMetric(java.lang.String metricName)
Retuns
true if this metric is registered in the Service Configuration. |
MetricDefinition |
getMetric(java.lang.String metricName)
Returns the specific
Metric instance for this Service Configuration. |
java.util.List |
getMetrics()
Returns an
Enumeration of Metric instances. |
boolean |
hasMetrics()
Retuns
true if this Service Configuration has metrics defined. |
java.util.List |
listMetrics()
Lists metrics for this service type.
|
void |
removeAllMetrics()
Removes all
Metric definitions from this Service Configuration. |
void |
removeMetric(java.lang.String metricName)
Removes a
Metric from the Service Configuration. |
getSerialVersionUID
public void removeMetric(java.lang.String metricName) throws ServiceConfigurationException
MetricsConfiguration
Metric
from the Service Configuration.removeMetric
in interface MetricsConfiguration
metricName
- String Name of the Metric.ServiceConfigurationException
- If the metric being removed is not found.public MetricDefinition getMetric(java.lang.String metricName) throws ServiceConfigurationException
MetricsConfiguration
Metric
instance for this Service Configuration.getMetric
in interface MetricsConfiguration
metricName
- String Name of Metric.ServiceConfigurationException
- If there is a problem or if the metric does nto exist.public java.util.List getMetrics()
MetricsConfiguration
Enumeration
of Metric instances.getMetrics
in interface MetricsConfiguration
public boolean hasMetrics()
MetricsConfiguration
true
if this Service Configuration has metrics defined.hasMetrics
in interface MetricsConfiguration
public void addMetric(MetricDefinition metric) throws ServiceConfigurationException
MetricsConfiguration
Metric
to the Service Configuration. Besides having a name and a description, all metrics allow users
to set minimum and maximum threshold values. A threshold may be used to denote a limit or a range (by setting the maximum and minimum).
It also offers the option to emit a State Notification
whe a threshold is crossed. The actual implementation is left up to
the implementer of the MetricsFactory
interface.addMetric
in interface MetricsConfiguration
metric
- MetricDefinitionServiceConfigurationException
- If a problem occurs when adding the metric.public void removeAllMetrics()
MetricsConfiguration
Metric
definitions from this Service Configuration.removeAllMetrics
in interface MetricsConfiguration
public java.util.List listMetrics()
MetricsConfiguration
listMetrics
in interface MetricsConfiguration
public boolean existsMetric(java.lang.String metricName)
MetricsConfiguration
true
if this metric is registered in the Service Configuration.existsMetric
in interface MetricsConfiguration
metricName
- Stringpublic java.lang.Object clone()
CloneableDataObject
clone
in interface CloneableObject
clone
in class CloneableDataObject
Copyright © 2015-2024 StreamScape Technologies. All rights reserved.