Class ProfilerTimerFilter.TimerWorker

java.lang.Object
org.apache.mina.filter.statistic.ProfilerTimerFilter.TimerWorker
Enclosing class:
ProfilerTimerFilter

private class ProfilerTimerFilter.TimerWorker extends Object
Class that will track the time each method takes and be able to provide information for each method.
  • Field Details

    • total

      private final AtomicLong total
      The sum of all operation durations
    • callsNumber

      private final AtomicLong callsNumber
      The number of calls
    • minimum

      private final AtomicLong minimum
      The fastest operation
    • maximum

      private final AtomicLong maximum
      The slowest operation
    • lock

      private final Object lock
      A lock for synchinized blocks
  • Constructor Details

    • TimerWorker

      public TimerWorker()
      Creates a new instance of TimerWorker.
  • Method Details

    • addNewDuration

      public void addNewDuration(long duration)
      Add a new operation duration to this class. Total is updated and calls is incremented
      Parameters:
      duration - The new operation duration
    • getAverage

      public double getAverage()
      Gets the average reading for this event
      Returns:
      the average reading for this event
    • getCallsNumber

      public long getCallsNumber()
      Returns:
      The total number of profiled operation
    • getTotal

      public long getTotal()
      Returns:
      the total time
    • getMinimum

      public long getMinimum()
      Returns:
      the lowest execution time
    • getMaximum

      public long getMaximum()
      Returns:
      the longest execution time