public interface MetricsFactory
Title: Service Event Fabric Core
Description: The Metric Factory
interface presents a set of functions required for implementing
a component's metric management capability. The implementation acts on the metrics rather then
their configuration. Metrics are stored in the component specific implementation structure.
Metrics provide a way for a service to expose critical run-time statistics about performance and general operations of
a Service. Developers implement the interface to create their own metric management classes that bind to a specific
service hosting infrastructure. Like all other Service factories the Metric Factory
is set by the specific
ServiceContext
implementation binding the Service to a specific execution environment. In
this way the implementation of the Context Adapter
makes the Service portable across hosting environments.
A factory is registered and instantiated by a Portable Context Adapter
. The adapter typically receives the
name of the Service Instance
and its type from the framework at initialization time. In the StreamScape environment
this is passed as part of the larger Semantic Object Reference
structure. Using this information the context
adapter gains access to the Service Configuration Object
and reads it's Metrics Registry
. The
adapter enumerates thru the metrics and registers them with the hosting framework upon loading the Service.
When the Service is shut down and destroyed the metrics are unregistered. It is expected that while metric definitions
are persistent and survive service re-start, the metric run-time objects registered by the factory are not persistent
and do not survive a service re-start. Metric values are stored in a transient data structure suitable for holding a
service's Run Time State
.
Copyright: Copyright (c) 2009
Company: StreamScape Technologies
Modifier and Type | Method and Description |
---|---|
Metric |
getMetric(java.lang.String metricName)
Returns the Metric definition.
|
long |
getMetricValue(java.lang.String metricName)
Gets the Metric value from the service hosting run-time collector.
|
java.util.List |
listMetricNames()
Returns a list of registered cv.
|
void |
nextMetricValue(java.lang.String metricName)
Increases the value of the metric by the incremental unit specified in the configuration.
|
void |
priorMetricValue(java.lang.String metricName)
Decreases the value of the metric by the incremental unit specified in the configuration.
|
void |
raiseMetricAdvisory(java.lang.String metricName)
Raises an advisory that contains the most recent Metric value.
|
void |
resetMetrics()
Resets the values of the metrics.
|
void |
setMetricValue(java.lang.String metricName,
long metricValue)
Sets the metric value in the service hosting run-time collector.
|
void raiseMetricAdvisory(java.lang.String metricName) throws MetricsFactoryException, FabricEventSourceException, FabricUnboundEventException, FabricEventException
metricName
- StringMetricsFactoryException
FabricEventSourceException
FabricUnboundEventException
FabricEventException
Metric getMetric(java.lang.String metricName) throws MetricsFactoryException
metricName
- String Metric name.Metric
instance.MetricsFactoryException
- Thrown if a metric definition is not found.void setMetricValue(java.lang.String metricName, long metricValue) throws MetricsFactoryException
metricName
- StringmetricValue
- longMetricsFactoryException
void nextMetricValue(java.lang.String metricName) throws MetricsFactoryException
metricName
- StringMetricsFactoryException
void priorMetricValue(java.lang.String metricName) throws MetricsFactoryException
metricName
- StringMetricsFactoryException
long getMetricValue(java.lang.String metricName) throws MetricsFactoryException
metricName
- String The Metric nameMetricsFactoryException
java.util.List listMetricNames()
void resetMetrics()
Copyright © 2015-2024 StreamScape Technologies. All rights reserved.