public class ActivityMetrics extends Object
| Modifier and Type | Field and Description |
|---|---|
static com.codahale.metrics.MetricFilter |
METRIC_FILTER |
| Modifier and Type | Method and Description |
|---|---|
static void |
addClassicHistos(String sessionName,
String pattern,
String prefix,
String interval)
Add a classic histogram in addition to the default implementation in this runtime.
|
static void |
addHistoLogger(String sessionName,
String pattern,
String filename,
String interval)
Add a histogram interval logger to matching metrics in this JVM instance.
|
static void |
addStatsLogger(String sessionName,
String pattern,
String filename,
String interval)
Add a histogram stats logger to matching metrics in this JVM instance.
|
static void |
closeMetrics()
This should be called at the end of a process, so that open intervals can be finished, logs closed properly,
etc.
|
static com.codahale.metrics.Counter |
counter(ActivityDef activityDef,
String name)
Create a counter associated with an activity.
|
static <T> com.codahale.metrics.Gauge<T> |
gauge(ActivityDef activityDef,
String name,
com.codahale.metrics.Gauge<T> gauge) |
static <T> com.codahale.metrics.Gauge<T> |
gauge(ScriptContext scriptContext,
String name,
com.codahale.metrics.Gauge<T> gauge) |
static com.codahale.metrics.MetricRegistry |
getMetricRegistry() |
static com.codahale.metrics.Histogram |
histogram(ActivityDef activityDef,
String name)
Create a histogram associated with an activity.
|
static com.codahale.metrics.Meter |
meter(ActivityDef activityDef,
String name)
Create a meter associated with an activity.
|
static void |
mountSubRegistry(String mountPrefix,
com.codahale.metrics.MetricRegistry subRegistry) |
static void |
removeActivityMetrics(ActivityDef activityDef) |
static void |
reportTo(PrintStream out) |
static com.codahale.metrics.Timer |
timer(ActivityDef activityDef,
String name)
Create a timer associated with an activity.
|
public static com.codahale.metrics.Timer timer(ActivityDef activityDef, String name)
Create a timer associated with an activity.
This method ensures that if multiple threads attempt to create the same-named metric on a given activity, that only one of them succeeds.
activityDef - an associated activity defname - a simple, descriptive name for the timerpublic static com.codahale.metrics.Histogram histogram(ActivityDef activityDef, String name)
Create a histogram associated with an activity.
This method ensures that if multiple threads attempt to create the same-named metric on a given activity, that only one of them succeeds.
activityDef - an associated activity defname - a simple, descriptive name for the histogrampublic static com.codahale.metrics.Counter counter(ActivityDef activityDef, String name)
Create a counter associated with an activity.
This method ensures that if multiple threads attempt to create the same-named metric on a given activity, that only one of them succeeds.
activityDef - an associated activity defname - a simple, descriptive name for the counterpublic static com.codahale.metrics.Meter meter(ActivityDef activityDef, String name)
Create a meter associated with an activity.
This method ensures that if multiple threads attempt to create the same-named metric on a given activity, that only one of them succeeds.
activityDef - an associated activity defname - a simple, descriptive name for the meterpublic static <T> com.codahale.metrics.Gauge<T> gauge(ActivityDef activityDef, String name, com.codahale.metrics.Gauge<T> gauge)
public static <T> com.codahale.metrics.Gauge<T> gauge(ScriptContext scriptContext, String name, com.codahale.metrics.Gauge<T> gauge)
public static com.codahale.metrics.MetricRegistry getMetricRegistry()
public static void addHistoLogger(String sessionName, String pattern, String filename, String interval)
sessionName - The name for the session to be annotated in the histogram logpattern - A regular expression pattern to filter out metric names for loggingfilename - A file to log the histogram data ininterval - How many seconds to wait between writing each interval histogrampublic static void addStatsLogger(String sessionName, String pattern, String filename, String interval)
sessionName - The name for the session to be annotated in the histogram logpattern - A regular expression pattern to filter out metric names for loggingfilename - A file to log the histogram data ininterval - How many seconds to wait between writing each interval histogrampublic static void addClassicHistos(String sessionName, String pattern, String prefix, String interval)
sessionName - The name of the session to be annotated in the classic histogrampattern - A regular expression pattern to filter out metric names for inclusionprefix - The name prefix to add to the classic histograms so that they fit into the existing metrics namespaceinterval - How frequently to setRateSpec the histogrampublic static void closeMetrics()
public static void reportTo(PrintStream out)
public static void mountSubRegistry(String mountPrefix, com.codahale.metrics.MetricRegistry subRegistry)
public static void removeActivityMetrics(ActivityDef activityDef)
Copyright © 2018. All rights reserved.