This class uses the metaphor of a 'photographic exposure' of, say, 10 minutes, whereby response times for a specific time interval are grouped together in a single bin, and average and maximum response times for that interval are derived for that group.
A particular PerformanceSnapshot is used only if its 'exposure time' has not yet ended. A typical 'exposure' lasts a few minutes. (See {@link hirondelle.web4j.webmaster.PerformanceMonitor} and the web.xml of the example application for more information.) By inspecting the return value of {@link #getEndTime}, the caller determines if a PerformanceSnapshot object can still be used, or if a new PerformanceSnapshot object must be created for the 'next exposure'.
This class is immutable. In particular, {@link #addResponseTime} returns a new object, instead of changing the state of an existing one.
|
|
|
|