|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.oozie.util.Instrumentation
public class Instrumentation
Instrumentation framework that supports Timers, Counters, Variables and Sampler instrumentation elements.
All instrumentation elements have a group and a name.
Nested Class Summary | |
---|---|
static class |
Instrumentation.Cron
Cron is a stopwatch that can be started/stopped several times. |
static interface |
Instrumentation.Element<T>
Gives access to a snapshot of an Instrumentation element (Counter, Timer). |
static class |
Instrumentation.Timer
Timer Instrumentation element. |
static interface |
Instrumentation.Variable<T>
Interface for instrumentation variables. |
Constructor Summary | |
---|---|
Instrumentation()
Instrumentation constructor. |
Method Summary | |
---|---|
void |
addCron(java.lang.String group,
java.lang.String name,
Instrumentation.Cron cron)
Add a cron to an instrumentation timer. |
void |
addSampler(java.lang.String group,
java.lang.String name,
int period,
int interval,
Instrumentation.Variable<java.lang.Long> variable)
Add a sampling variable. |
void |
addVariable(java.lang.String group,
java.lang.String name,
Instrumentation.Variable variable)
Add an instrumentation variable. |
java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>>> |
getAll()
Return a map containing all variables, counters and timers. |
java.util.Map<java.lang.String,java.lang.String> |
getConfiguration()
Return the current system configuration as a Map |
java.util.Map<java.lang.String,java.util.Map<java.lang.String,Instrumentation.Element<java.lang.Long>>> |
getCounters()
Return all the counters. |
java.util.Map<java.lang.String,java.lang.String> |
getJavaSystemProperties()
Return the JVM system properties. |
java.util.Map<java.lang.String,java.lang.String> |
getOSEnv()
Return the OS environment used to start Oozie. |
java.util.Map<java.lang.String,java.util.Map<java.lang.String,Instrumentation.Element<java.lang.Double>>> |
getSamplers()
Return all the samplers. |
java.util.Map<java.lang.String,java.util.Map<java.lang.String,Instrumentation.Element<Instrumentation.Timer>>> |
getTimers()
Return all the timers. |
java.util.Map<java.lang.String,java.util.Map<java.lang.String,Instrumentation.Element<Instrumentation.Variable>>> |
getVariables()
Return all the variables. |
void |
incr(java.lang.String group,
java.lang.String name,
long count)
Increment an instrumentation counter. |
void |
setConfiguration(org.apache.hadoop.conf.Configuration configuration)
Set the system configuration. |
void |
setScheduler(java.util.concurrent.ScheduledExecutorService scheduler)
Set the scheduler instance to handle the samplers. |
java.lang.String |
toString()
Return the string representation of the instrumentation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Instrumentation()
Method Detail |
---|
public void setScheduler(java.util.concurrent.ScheduledExecutorService scheduler)
scheduler
- scheduler instance.public void addCron(java.lang.String group, java.lang.String name, Instrumentation.Cron cron)
group
- timer group.name
- timer name.cron
- cron to add to the timer.public void incr(java.lang.String group, java.lang.String name, long count)
group
- counter group.name
- counter name.count
- increment to add to the counter.public void addVariable(java.lang.String group, java.lang.String name, Instrumentation.Variable variable)
group
- counter group.name
- counter name.variable
- variable to add.public void setConfiguration(org.apache.hadoop.conf.Configuration configuration)
configuration
- system configuration.public java.util.Map<java.lang.String,java.lang.String> getJavaSystemProperties()
public java.util.Map<java.lang.String,java.lang.String> getOSEnv()
public java.util.Map<java.lang.String,java.lang.String> getConfiguration()
public java.util.Map<java.lang.String,java.util.Map<java.lang.String,Instrumentation.Element<java.lang.Long>>> getCounters()
Instrumentation.Element.getValue()
is invoked.
public java.util.Map<java.lang.String,java.util.Map<java.lang.String,Instrumentation.Element<Instrumentation.Timer>>> getTimers()
Instrumentation.Element.getValue()
is
invoked.
public java.util.Map<java.lang.String,java.util.Map<java.lang.String,Instrumentation.Element<Instrumentation.Variable>>> getVariables()
Instrumentation.Element.getValue()
is invoked.
public java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>>> getAll()
public java.lang.String toString()
toString
in class java.lang.Object
public void addSampler(java.lang.String group, java.lang.String name, int period, int interval, Instrumentation.Variable<java.lang.Long> variable)
group
- timer group.name
- timer name.period
- sampling period to compute rate.interval
- sampling frequency, how often the variable is probed.variable
- variable to sample.public java.util.Map<java.lang.String,java.util.Map<java.lang.String,Instrumentation.Element<java.lang.Double>>> getSamplers()
Instrumentation.Element.getValue()
is invoked.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |