public class MetricGroupType
extends java.lang.Object
MetricGroup
object.
Each MetricGroupType
must be registered with the
MetricGroupTypeRegistry
.
MetricGroupTypes
may be
defined within the Gateway's configuration store, these MetricGroupTypes
will be automatically registered.
For example, some of the MetricGroupTypes
defined by default are:- Service, Client, TargetServer,
SystemOverview. Please refer to the documentation for a complete list of
MetricGroupTypes
defined in the Gateway's configuration store.
It is possible via the Metrics API, to create a custom MetricGroup
whose associated
MetricGroupType
is not defined in the Gateway's configuration store.
Please refer to the MetricGroup
Javadoc for more information.
The MetricGroupType
defines the list of metrics
that may be generated for a MetricGroup
.
A map of MetricType
objects
in the MetricGroupType
object defines this list of metrics.
MetricGroupType
may have n child MetricGroupTypes
.
For example, the Service MetricGroupType
has a child
MetricGroupType
for each Method. In this way it is possible to
generate metrics that are for a service and method combination, e.g. how may
times did method getQuote get invoked on the service StockQuote.MetricGroup
,
MetricType
Modifier and Type | Class and Description |
---|---|
static class |
MetricGroupType.MetricDestination
The metric destinations.
|
Constructor and Description |
---|
MetricGroupType(java.lang.String name)
Construct a
MetricGroupType . |
MetricGroupType(java.lang.String name,
java.util.List<MetricType> metricTypes)
Construct a
MetricGroupType . |
MetricGroupType(java.lang.String name,
java.lang.String[] metricNames)
Construct a
MetricGroupType with a set of named
MetricTypeValue
metric types. |
Modifier and Type | Method and Description |
---|---|
void |
addMetricType(MetricType type)
Add a
MetricType to the MetricGroupType . |
int |
getMaxNumMetricGroups()
Returns the maximum number of metric groups of this type for which
counters will be maintained in memory.
|
static int |
getMaxNumMetricGroupsPerType()
Returns the maximum number of MetricGroups that will be tracked for
any MetricGroupType.
|
java.util.List<java.lang.String> |
getMetricNames()
Get the names of the metrics that will be generated for the
MetricGroupType . |
MetricType |
getMetricType(java.lang.String name)
Gets a MetricType by name.
|
java.lang.String |
getMetricTypeNameByMetricName(java.lang.String name)
Gets a metric type name from a metric name.
|
java.util.Map<java.lang.String,MetricType> |
getMetricTypes()
Get the allowed metrics that are defined for this type of
MetricGroupType . |
java.lang.String |
getName()
Get the name of the
MetricGroupType . |
boolean |
hasMetricType(java.lang.String name)
Checks to see if this
MetricGroupType has the named MetricType
in its list of generated metrics. |
boolean |
isEnabled()
Returns true if realtime metrics are being collected for groups of this
type, false otherwise.
|
void |
setChildMetricGroupTypes(java.util.List<MetricGroupType> childMetricGroupTypes)
Set the child
MetricGroupTypes . |
void |
setDestination(java.util.EnumSet<MetricGroupType.MetricDestination> destination)
Set the destination of the metric group type to RealtimeCache, or
EventLog or both.
|
void |
setEnabled(boolean enabled)
Enables or disables this MetricGroupType.
|
void |
setMaxNumMetricGroups(int maxNumMetricGroups)
Sets the maximum number of metric groups of this type for which counters will
be maintained in memory.
|
static void |
setMaxNumMetricGroupsPerType(int maxGroupsPerType)
Sets the maximum number of MetricGroups that will be tracked for any
MetricGroupType.
|
void |
setMetricTypes(java.util.Map<java.lang.String,MetricType> types)
Set the allowed metrics that are defined for this type of
MetricGroupType . |
boolean |
shouldStoreInRealtimeCache()
Returns true if this metric should be stored in the realtime cache.
|
boolean |
shouldWriteToEventLog()
Returns true if this metric should be written to the event log.
|
public MetricGroupType(java.lang.String name)
MetricGroupType
.name
- The name of the MetricGroupType
, e.g. Service.public MetricGroupType(java.lang.String name, java.util.List<MetricType> metricTypes)
MetricGroupType
.name
- The name of the MetricGroupType
, e.g. Service.metricTypes
- The metrics that can be generated for this MetricGroupType
.public MetricGroupType(java.lang.String name, java.lang.String[] metricNames)
MetricGroupType
with a set of named
MetricTypeValue
metric types.name
- The name of the MetricGroupType
, e.g. Service.metricNames
- The names of the MetricTypeValue
metrics that can be generated for this MetricGroupType
.
These metrics will have no minimum, maximum, or average values
generated. The values will be reset at the start of each time
window.public static void setMaxNumMetricGroupsPerType(int maxGroupsPerType)
maxGroupsPerType
- The maximum number of groups to be tracked per type.public static int getMaxNumMetricGroupsPerType()
public java.lang.String getName()
MetricGroupType
.public void addMetricType(MetricType type)
MetricType
to the MetricGroupType
. This
must be done before the MetricGroupType
is registered.type
- The metric typejava.lang.IllegalArgumentException
- If you add a MetricType
whose generated metric names exists already in
another MetricType
.public java.util.Map<java.lang.String,MetricType> getMetricTypes()
MetricGroupType
.public boolean hasMetricType(java.lang.String name)
MetricGroupType
has the named MetricType
in its list of generated metrics.name
- The name of the metric to checkMetricGroupType
can generate the metricpublic MetricType getMetricType(java.lang.String name)
name
- The name of the metric.public java.lang.String getMetricTypeNameByMetricName(java.lang.String name)
name
- The name of the metricpublic void setMetricTypes(java.util.Map<java.lang.String,MetricType> types)
MetricGroupType
. This
must be done before the MetricGroupType
is registered.types
- Map of metrics where the key is the metric namepublic void setChildMetricGroupTypes(java.util.List<MetricGroupType> childMetricGroupTypes)
MetricGroupTypes
.
This must be done before the MetricGroupType
is registered.childMetricGroupTypes
- The child MetricGroupTypes
.public java.util.List<java.lang.String> getMetricNames()
MetricGroupType
.
If the metric has a minimum, maximum, or average metric those names will be
added to the list of metric names.
If the metric is a MetricTypeRangeCount
, the names are those of the
individual ranges not the top-level metric, i.e. respTimeRange1,
respTimeRange2 etc, not respTimeRange.public void setMaxNumMetricGroups(int maxNumMetricGroups)
MetricGroupType
is registered.maxNumMetricGroups
- The maximum number of metric groups for which data
will be stored in memory. Value '0' indicates that the global system limit
should be used.public int getMaxNumMetricGroups()
public void setEnabled(boolean enabled)
enabled
- Set to true to enable this MetricGroupType, false otherwise.public boolean isEnabled()
public void setDestination(java.util.EnumSet<MetricGroupType.MetricDestination> destination)
destination
- A set of enums indicating the desired destinations for metrics.public boolean shouldStoreInRealtimeCache()
public boolean shouldWriteToEventLog()
This documentation and all its contents and graphics, copyright © 1999 - 2011 Vordel