Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Minimalistic library for collecting and exposing performance statistics for methods
Tree: 1db30e912a

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.

INTRO Light-weight, minimalistic, low-overhead lib for collecting and publishing performance statistics in production systems. Calls to the lib are usually injected via AOP.


  • code calls Statistics.recordMeasurement(String metricName, long duration [, unit])
  • the measurement is added to a list of values to process and the call returns
  • a background thread processes new measurement, updating aggregate values etc.
  • the collected values are made available via publishers such as JmxPublisher and PeriodicalLogPublisher


Statistics.recordMeasurement("myBizMethod", 60); // => asynch. stored and updated count, avg, min, max,, ... // Computation strategy: rolling window x all values


  • ignore lowest and highest N values (random extreems far behind normal values)
  • count avg, 10 min, 10 max,
  • running avg/dev or based on all values


Count attribute The number of times this event has occurred. ErrorCount attribute The number of times this event ended in error. AverageTime attribute The average execution time, in the selected unit. MaxTime attribute The maximum execution time, in the selected unit. MinTime attribute The minimum execution time, in the selected unit. StandardDeviation attribute The standard deviation from the mean, in the selected unit. LastInvocation attribute The most recent date and time at which this event occurred. Units attribute The unit of measure for max, min, average, and stddev. Valid values are seconds, milliseconds, and nanoseconds. Defaults to milliseconds if unspecified. reset operation Reset statistics for this type of event.

Something went wrong with that request. Please try again.