|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.oozie.util.Instrumentation
org.apache.oozie.util.MetricsInstrumentation
public class MetricsInstrumentation
Instrumentation framework that is mostly compatible with Instrumentation but is backed by Codahale Metrics. This class
was designed to minimize the changes required to switch from Instrumentation to MetricsInstrumentation by keeping
the same API. However, certain operations are obviously implemented differently or are no longer needed; and the output format
is a little different. Internally, this class maps Cron to Timer, Variable to Gauge,
counter to Counter, and Sampler to Histogram.
| Nested Class Summary | |
|---|---|
static class |
MetricsInstrumentation.Sampler
|
| Nested classes/interfaces inherited from class org.apache.oozie.util.Instrumentation |
|---|
Instrumentation.Cron, Instrumentation.Element<T>, Instrumentation.Timer, Instrumentation.Variable<T> |
| Constructor Summary | |
|---|---|
MetricsInstrumentation()
Creates the MetricsInstrumentation and starts taking some metrics. |
|
| Method Summary | |
|---|---|
void |
addCron(String group,
String name,
Instrumentation.Cron cron)
Add a cron to an instrumentation timer. |
void |
addSampler(String group,
String name,
int period,
int interval,
Instrumentation.Variable<Long> variable)
Add a sampling variable. |
void |
addVariable(String group,
String name,
Instrumentation.Variable variable)
Add an instrumentation variable. |
Map<String,Map<String,Map<String,Object>>> |
getAll()
Not Supported: throws UnsupportedOperationException |
Map<String,Map<String,Instrumentation.Element<Long>>> |
getCounters()
Not Supported: throws UnsupportedOperationException |
Map<String,Map<String,Instrumentation.Element<Double>>> |
getSamplers()
Not Supported: throws UnsupportedOperationException |
Map<String,Map<String,Instrumentation.Element<Instrumentation.Timer>>> |
getTimers()
Not Supported: throws UnsupportedOperationException |
Map<String,Map<String,Instrumentation.Element<Instrumentation.Variable>>> |
getVariables()
Not Supported: throws UnsupportedOperationException |
void |
incr(String group,
String name,
long count)
Increment an instrumentation counter. |
void |
setScheduler(ScheduledExecutorService scheduler)
Set the scheduler instance to handle the samplers. |
String |
toString()
Return the string representation of the instrumentation. |
void |
writeJSONResponse(OutputStream os)
Converts the current state of the metrics and writes them to the OutputStream. |
| Methods inherited from class org.apache.oozie.util.Instrumentation |
|---|
getConfiguration, getJavaSystemProperties, getOSEnv |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MetricsInstrumentation()
| Method Detail |
|---|
public void addCron(String group,
String name,
Instrumentation.Cron cron)
Timer.
addCron in class Instrumentationgroup - timer group.name - timer name.cron - cron to add to the timer.
public void addVariable(String group,
String name,
Instrumentation.Variable variable)
Gauge.
addVariable in class Instrumentationgroup - counter group.name - counter name.variable - variable to add.
public void incr(String group,
String name,
long count)
Counter.
incr in class Instrumentationgroup - counter group.name - counter name.count - increment to add to the counter.
public void addSampler(String group,
String name,
int period,
int interval,
Instrumentation.Variable<Long> variable)
Histogram.
addSampler in class Instrumentationgroup - timer group.name - timer name.period - (ignored)interval - sampling frequency, how often the variable is probed.variable - variable to sample.public void setScheduler(ScheduledExecutorService scheduler)
setScheduler in class Instrumentationscheduler - scheduler instance.public String toString()
toString in class Instrumentation
public void writeJSONResponse(OutputStream os)
throws IOException
os - The OutputStream to write the metrics to
IOExceptionpublic Map<String,Map<String,Map<String,Object>>> getAll()
UnsupportedOperationException
getAll in class Instrumentationpublic Map<String,Map<String,Instrumentation.Element<Long>>> getCounters()
UnsupportedOperationException
getCounters in class Instrumentationpublic Map<String,Map<String,Instrumentation.Element<Double>>> getSamplers()
UnsupportedOperationException
getSamplers in class Instrumentationpublic Map<String,Map<String,Instrumentation.Element<Instrumentation.Timer>>> getTimers()
UnsupportedOperationException
getTimers in class Instrumentationpublic Map<String,Map<String,Instrumentation.Element<Instrumentation.Variable>>> getVariables()
UnsupportedOperationException
getVariables in class Instrumentation
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||