|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.is24.util.monitoring.AbstractMonitorPlugin
de.is24.util.monitoring.CorePlugin
public class CorePlugin
This plugin represents the former core functionality of InApplicationMonitor, on a way to a more flexible implementation by plugins, to simplify testing and the first step on the way fo a more dependency injection friendly implementation. This plugin will take over some functionality that only makes sense in the context of a plugin that stores data locally in the JVM. Other plugins (namely the statsd plugin) move data aggregation out of the JVM. And thus it makes no sense to let them implement some of the patterns like reportableObserver etc.
| Field Summary | |
|---|---|
private Monitors<Counter> |
countersTimers
|
private Monitors<HistorizableList> |
historizableLists
|
private static org.apache.log4j.Logger |
LOGGER
|
private int |
maxHistoryEntriesToKeep
|
protected boolean |
monitorActive
|
private Vector<ReportableObserver> |
reportableObservers
|
private Monitors<StateValueProvider> |
stateValues
|
private Monitors<Version> |
versions
|
| Constructor Summary | |
|---|---|
CorePlugin()
|
|
| Method Summary | |
|---|---|
void |
addHighRateTimerMeasurement(String name,
long timing)
Add a timer measurement for a rarely occuring event with given name. |
void |
addHistorizable(String name,
Historizable historizable)
add a Historizable instance to the list identified by historizable.getName() |
void |
addReportableObserver(ReportableObserver reportableObserver)
adds a new ReportableObserver that wants to be notified about new Reportables that are registered on the InApplicationMonitor |
void |
addSingleEventTimerMeasurement(String name,
long timing)
Add a timer measurement for a rarely occuring event with given name. |
void |
addTimerMeasurement(String name,
long timing)
Add a timer measurement for the given name. |
(package private) Counter |
getCounter(String name)
internally used method to retrieve or create and register a named Counter. |
(package private) HistorizableList |
getHistorizableList(String name)
internally used method to retrieve or create and register a named HistorizableList. |
int |
getMaxHistoryEntriesToKeep()
|
(package private) StateValueProvider |
getStateValue(String name)
|
(package private) Timer |
getTimer(String name)
internaly used method to retrieve or create and register a named Timer. |
String |
getUniqueName()
|
void |
incrementCounter(String name,
int increment)
Increase the specified counter by a variable amount. |
void |
incrementHighRateCounter(String name,
int increment)
|
private void |
incrementInternalCounter(int increment,
String name)
|
void |
initializeCounter(String name)
Initialization of a counter. |
void |
initializeTimerMeasurement(String name)
Initialization of a TimerMeasurement |
private void |
notifyReportableObservers(Reportable reportable)
|
void |
registerStateValue(String name,
StateValueProvider stateValueProvider)
Add a state value provider to this appmon4j instance. |
void |
registerVersion(Version versionToAdd)
This method was intended to register module names with their current version identifier. |
void |
removeReportableObserver(ReportableObserver reportableObserver)
Allow disconnection of observers, mainly for testing |
void |
reportInto(ReportVisitor reportVisitor)
Implements the InApplicationMonitor side of the Visitor pattern. |
void |
setMaxHistoryEntriesToKeep(int aMaxHistoryEntriesToKeep)
Set the Number of entries to keep for each Historizable list. |
| Methods inherited from class de.is24.util.monitoring.AbstractMonitorPlugin |
|---|
equals, hashCode, register |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static org.apache.log4j.Logger LOGGER
protected volatile boolean monitorActive
private volatile int maxHistoryEntriesToKeep
private final Vector<ReportableObserver> reportableObservers
private final Monitors<Counter> countersTimers
private final Monitors<StateValueProvider> stateValues
private final Monitors<Version> versions
private final Monitors<HistorizableList> historizableLists
| Constructor Detail |
|---|
public CorePlugin()
| Method Detail |
|---|
public String getUniqueName()
public int getMaxHistoryEntriesToKeep()
public void setMaxHistoryEntriesToKeep(int aMaxHistoryEntriesToKeep)
aMaxHistoryEntriesToKeep - Number of entries to keeppublic void addReportableObserver(ReportableObserver reportableObserver)
reportableObserver - the class that wants to be notifiedprivate void notifyReportableObservers(Reportable reportable)
public void removeReportableObserver(ReportableObserver reportableObserver)
reportableObserver - public void reportInto(ReportVisitor reportVisitor)
InApplicationMonitor side of the Visitor pattern.
Iterates through all registered Reportable instances and calls
the corresponding method on the ReportVisitor implementation.
reportVisitor - The ReportVisitor instance that shall be visited
by all regieteres Reportable instances.
public void incrementCounter(String name,
int increment)
Increase the specified counter by a variable amount.
name - the name of the Counter to increaseincrement - the added to add
public void incrementHighRateCounter(String name,
int increment)
private void incrementInternalCounter(int increment,
String name)
public void initializeCounter(String name)
name - the name of the counter to be initialized
public void addTimerMeasurement(String name,
long timing)
Timers allow adding timer measurements, implicitly incrementing the count
Timers count and measure timed events.
The application decides which unit to use for timing.
Miliseconds are suggested and some ReportVisitor implementations
may imply this.
name - name of the Timertiming - number of elapsed time units for a single measurement
public void addSingleEventTimerMeasurement(String name,
long timing)
Timers allow adding timer measurements, implicitly incrementing the count
Timers count and measure timed events.
The application decides which unit to use for timing.
Miliseconds are suggested and some ReportVisitor implementations
may imply this.
name - name of the Timertiming - number of elapsed time units for a single measurement
public void addHighRateTimerMeasurement(String name,
long timing)
Timers allow adding timer measurements, implicitly incrementing the count
Timers count and measure timed events.
The application decides which unit to use for timing.
Miliseconds are suggested and some ReportVisitor implementations
may imply this.
name - name of the Timertiming - number of elapsed time units for a single measurementpublic void initializeTimerMeasurement(String name)
name - the name of the timer to be initialized
public void registerStateValue(String name,
StateValueProvider stateValueProvider)
StateValueProvider instances allow access to a numeric
value (long), that is already available in the application.
stateValueProvider - the StateValueProvider instance to addpublic void registerVersion(Version versionToAdd)
versionToAdd - The Version Object to add
public void addHistorizable(String name,
Historizable historizable)
Historizable instance to the list identified by historizable.getName()
historizable - the historizable to addStateValueProvider getStateValue(String name)
name - the name of the StatsValueProvider
Counter getCounter(String name)
Counter.
name - of the required Counter
Counter instance registered for the given nameTimer getTimer(String name)
Timer.
name - of the required Timer
Timer instance registered for the given nameHistorizableList getHistorizableList(String name)
name - of the required HistorizableList
HistorizableList instance registered for the given name
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||