Class TimerDecorator

  • All Implemented Interfaces:
    Decorator

    public class TimerDecorator
    extends AbstractHandlerAndFilterDecorator
    The timer decorator can decorate both 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.