Package org.javasimon

Core package, contains Simon implementations, with the SimonManager as the center point of the API.

See:
          Description

Interface Summary
Counter Counter tracks the single integer value and watches its max/min values.
HasAttributes Interface that declares support for arbitrary attributes that can be attached to the object (servlet style).
Manager Manager provides access to Simons and manages them in a tree structure.
Simon Simon interface contains common functions related to Simon management - enable/disable and hierarchy.
Stopwatch Stopwatch Simon measures time spans and holds related statistics.
 

Class Summary
AbstractSimon AbstractSimon implements basic enable/disable and hierarchy functionality.
AttributesSupport Attributes implementation that creates attributes map lazily.
CounterImpl Class implements Counter interface - see there for how to use Counter.
CounterSample CounterSample.
DisabledManager Manager implementation that does nothing or returns null or NullSimon as expected from manager in disabled state.
EnabledManager Implements fully functional Manager in the enabled state.
ManagerConfiguration Holds configuration for one Simon Manager.
NullCounter Null Counter implements Simon returned by the disabled Manager.getCounter(String).
NullSimon Null Simon implements Simon returned by the disabled Manager.getSimon(String) or Manager.getRootSimon().
NullStopwatch Null Stopwatch implements Simon returned by the disabled Manager.getStopwatch(String).
Sample Sample contains all relevant values of the Simon that are obtained by the Simon.sample() and Simon.sampleAndReset() methods.
SimonConfiguration Stores configuration for the particular Simon or the set of Simons.
SimonManager SimonManager is static utility class providing so called "default Manager.
SimonPattern Matches Simon name patterns from configuration.
Split Represents single time split - one Stopwatch measurement.
StopwatchImpl Class implements Stopwatch interface - see there for how to use Stopwatch.
StopwatchSample Object holds all relevant data from Stopwatch Simon.
SwitchingManager Manager implementation that supports SwitchingManager.enable() and SwitchingManager.disable() and switches between backing EnabledManager and DisabledManager accordingly.
UnknownSample Sample produced by UnknownSimons.
UnknownSimon UnknownSimon represents Simon node in the hierarchy without known type.
 

Enum Summary
SimonState Status of monitor.
 

Exception Summary
SimonException SimonException is runtime exception thrown in case something goes seriously wrong (class cast or similar).
 

Package org.javasimon Description

Core package, contains Simon implementations, with the SimonManager as the center point of the API.

Core package contains all basic interfaces (Simon, Counter, Stopwatch and Manager) with their implementations along with SimonManager that provides convenient access to the default Simon Manger.

There are two basic types of Simons provided:

All Simons share some basic functions - these are implemented in AbstractSimon. Simons are organized in the tree - methods Simon.getChildren() and Simon.getParent() can be used to traverse it along with SimonManager.getRootSimon(). This tree is also important to determine if the Simon is enabled or disabled. Disabled Simon has minimal possible overhead - but it does not count or measure anything. Simon's state is specified by Simon.setState(SimonState, boolean). SimonState enumeration has three values: SimonState.ENABLED sets Simon as enabled, SimonState.DISABLED sets Simon as disabled and SimonState.INHERIT lets Simon to inherit its state from the parent (recursively).

The whole SimonManager can be enabled or disabled - this is importand difference from disabled Simons. Whenever SimonManager is disabled (SimonManager.disable()) any method returning Simon returns NullSimon. Null Simon is different from the disabled Simon because it does nothing and always returns zero/empty values if value is expected. Null Simon is always disabled and cannot be enabled. If the SimonManager is enabled again (SimonManager.enable()) it returns real Simons again. This leads to following recommendations:

Bottom line: If you want to use Simon, get it from SimonManager when needed and don not cache it. (Unless you know what you're doing.)

TODO: Configuration



Copyright © 2013. All Rights Reserved.