public class TimerDecorator extends AbstractHandlerAndFilterDecorator
Filter
and
Handler
instances. It will log elapsed time within the decorated heap
object.
It has to be declared inside of the heap objects section:
{
"name": "myTimerDecorator",
"type": "TimerDecorator"
}
If you want to specify the time unit:
{
"name": "myTimerDecorator",
"type": "TimerDecorator"
"config": {
"timeUnit": "ms"
}
}
The value of the timeUnit is a single string representation of the
elapsed time unit as those supported by Duration
. An invalid string
or non recognized time unit will throw an error.
To decorate a component, just add the decorator declaration next to the
config
element:
{
"type": "...",
"timer": true,
"config": { ... }
}
A default timer decorator is automatically created when IG
starts.Modifier and Type | Class and Description |
---|---|
static class |
TimerDecorator.Heaplet
Creates and initializes a TimerDecorator in a heap environment.
|
Modifier and Type | Method and Description |
---|---|
protected DecorationHandle |
decorateFilter(Filter delegate,
JsonValue decoratorConfig,
Context context)
|
protected DecorationHandle |
decorateHandler(Handler delegate,
JsonValue decoratorConfig,
Context context)
|
accepts, decorate
getLogger
protected DecorationHandle decorateFilter(Filter delegate, JsonValue decoratorConfig, Context context) throws HeapException
AbstractHandlerAndFilterDecorator
decorateFilter
in class AbstractHandlerAndFilterDecorator
delegate
- Filter instance to be decorateddecoratorConfig
- the decorator configuration to applycontext
- contextual information of the decorated instanceHeapException
- when decoration failsprotected DecorationHandle decorateHandler(Handler delegate, JsonValue decoratorConfig, Context context) throws HeapException
AbstractHandlerAndFilterDecorator
decorateHandler
in class AbstractHandlerAndFilterDecorator
delegate
- Handler instance to be decorateddecoratorConfig
- the decorator configuration to applycontext
- contextual information of the decorated instanceHeapException
- when decoration failsCopyright 2011-2017 ForgeRock AS.