public final class FactoryDisabled extends Object implements MonitorFactoryInterface
VERSION
Constructor and Description |
---|
FactoryDisabled(MonitorFactoryInterface factoryEnabled)
Creates a new instance of FactoryDisabled
|
Modifier and Type | Method and Description |
---|---|
Monitor |
add(MonKey key,
double value)
Used when you want to create your own key for the monitor.
|
Monitor |
add(String label,
String units,
double value)
Return a monitor with the given label and units.
|
Monitor |
addException(Monitor mon,
Throwable throwable)
Add 2 exception monitors.
|
Monitor |
addException(Throwable throwable)
Track an exception except there is no other associated monitor to put the details in.
|
void |
addListeners(List<JamonPropertiesLoader.JamonListenerProperty> listeners)
Add listeners.
|
FactoryDisabled |
copy() |
void |
disableTotalKeySizeTracking() |
void |
enableActivityTracking(boolean enable)
This determines if activity tracking in ranges is enabled.
|
void |
enableGlobalActive(boolean enable) |
void |
enableTotalKeySizeTracking()
This will keep track of the total size of of the keys used to store the monitors which can be useful in keeping track of memory used by JAMon.
|
boolean |
exists(MonKey key)
Return true if the monitor associated with the passed in key exists
|
boolean |
exists(String label,
String units)
Return true if the monitor associated with the passed in label and units exists
|
MonitorComposite |
getComposite(String units)
Return the composite monitor associated with the passed unit.
|
Map |
getMap()
Get the backing map that holds the the Monitors.
|
int |
getMaxNumMonitors()
Return the max number of configured of monitors.
|
int |
getMaxSqlSize()
Return the size that sql statements can be before truncating them.
|
Monitor |
getMonitor()
Returns a non-TimeMonitor that won't update the jamon factory.
|
Monitor |
getMonitor(MonKey key)
Get the monitor associated with the passed in key.
|
Monitor |
getMonitor(String label,
String units)
Get the monitor with the passed in label, and units.
|
int |
getNumRows()
Get the number of monitors in this factory
|
String[] |
getRangeHeader()
Return the header associated with range names
|
Object[][] |
getRangeNames()
Return an array of range names.
|
MonitorComposite |
getRootMonitor()
Get the root composite monitor that contains all monitors in this factory
|
Monitor |
getTimeMonitor(MonKey key)
Get the time monitor associated with the passed in key.
|
Monitor |
getTimeMonitor(String label)
Get the time monitor associated with the passed in label.
|
long |
getTotalKeySize() |
String |
getVersion()
Get JAMon's version.
|
boolean |
isActivityTrackingEnabled() |
boolean |
isGlobalActiveEnabled() |
boolean |
isTotalKeySizeTrackingEnabled() |
Iterator |
iterator() |
void |
remove(MonKey key)
Remove the monitor associated with the passed in key
|
void |
remove(String label,
String units)
Remove the monitor associated with the passed in label and units
|
void |
reset()
Reset jamon stats for this factory.
|
void |
setMap(Map map)
Set the map that holds the monitors.
|
void |
setMaxNumMonitors(int maxMonitors)
Set the max number of monitors that can be tracked.
|
void |
setMaxSqlSize(int size)
Set the maximum size for a sql statement.
|
void |
setRangeDefault(String key,
RangeHolder rangeHolder)
Associate a Range mapping to any monitor that has a unit/key name that matches what is passed to key
|
Monitor |
start()
Returns a TimeMonitor that won't update the jamon factory.
|
Monitor |
start(MonKey key)
Start using the passed in key.
|
Monitor |
start(String label)
Return a time monitor (the units are implied and are ms.
|
Monitor |
startNano(MonKey key)
Provide your own key to a nanosecond timer
|
Monitor |
startNano(String label)
Create a timing monitor that uses nanosecond granularity (1,000,000 ns.=1 ms.)
|
Monitor |
startPrimary(MonKey key)
Start a monitor with the specified key and mark it as primary
|
Monitor |
startPrimary(String label)
Start a time monitor and mark it as primary
|
public FactoryDisabled(MonitorFactoryInterface factoryEnabled)
public Monitor add(MonKey key, double value)
MonitorFactoryInterface
add
in interface MonitorFactoryInterface
public Monitor add(String label, String units, double value)
MonitorFactoryInterface
Sample Call: factory.add("com.fdsapi.MyException", "error", 1);
add
in interface MonitorFactoryInterface
public Monitor start()
MonitorFactoryInterface
start
in interface MonitorFactoryInterface
public Monitor start(MonKey key)
MonitorFactoryInterface
start
in interface MonitorFactoryInterface
public Monitor start(String label)
MonitorFactoryInterface
start
in interface MonitorFactoryInterface
public Monitor startNano(String label)
MonitorFactoryInterface
startNano
in interface MonitorFactoryInterface
public Monitor startNano(MonKey key)
MonitorFactoryInterface
startNano
in interface MonitorFactoryInterface
public Monitor startPrimary(MonKey key)
MonitorFactoryInterface
startPrimary
in interface MonitorFactoryInterface
public Monitor startPrimary(String label)
MonitorFactoryInterface
startPrimary
in interface MonitorFactoryInterface
public Monitor getMonitor(MonKey key)
MonitorFactoryInterface
getMonitor
in interface MonitorFactoryInterface
public Monitor getMonitor(String label, String units)
MonitorFactoryInterface
getMonitor
in interface MonitorFactoryInterface
public Monitor getTimeMonitor(MonKey key)
MonitorFactoryInterface
getTimeMonitor
in interface MonitorFactoryInterface
public Monitor addException(Monitor mon, Throwable throwable)
MonitorFactoryInterface
addException
in interface MonitorFactoryInterface
mon
- optional monitor where we want to store the stack trace.throwable
- exception that we want to create a monitor forpublic Monitor addException(Throwable throwable)
MonitorFactoryInterface
addException
in interface MonitorFactoryInterface
throwable
- exception to create a monitor for.public Monitor getTimeMonitor(String label)
MonitorFactoryInterface
getTimeMonitor
in interface MonitorFactoryInterface
public void remove(MonKey key)
MonitorFactoryInterface
remove
in interface MonitorFactoryInterface
public void remove(String label, String units)
MonitorFactoryInterface
remove
in interface MonitorFactoryInterface
public boolean exists(MonKey key)
MonitorFactoryInterface
exists
in interface MonitorFactoryInterface
public boolean exists(String label, String units)
MonitorFactoryInterface
exists
in interface MonitorFactoryInterface
public MonitorComposite getComposite(String units)
MonitorFactoryInterface
getComposite
in interface MonitorFactoryInterface
public MonitorComposite getRootMonitor()
MonitorFactoryInterface
getRootMonitor
in interface MonitorFactoryInterface
public int getNumRows()
MonitorFactoryInterface
getNumRows
in interface MonitorFactoryInterface
public String[] getRangeHeader()
MonitorFactoryInterface
getRangeHeader
in interface MonitorFactoryInterface
public Object[][] getRangeNames()
MonitorFactoryInterface
getRangeNames
in interface MonitorFactoryInterface
public String getVersion()
MonitorFactoryInterface
getVersion
in interface MonitorFactoryInterface
public void setMap(Map map)
MonitorFactoryInterface
setMap
in interface MonitorFactoryInterface
public void setRangeDefault(String key, RangeHolder rangeHolder)
MonitorFactoryInterface
setRangeDefault
in interface MonitorFactoryInterface
public void reset()
MonitorFactoryInterface
reset
in interface MonitorFactoryInterface
public void enableGlobalActive(boolean enable)
enableGlobalActive
in interface MonitorFactoryInterface
public boolean isGlobalActiveEnabled()
isGlobalActiveEnabled
in interface MonitorFactoryInterface
public Monitor getMonitor()
MonitorFactoryInterface
getMonitor
in interface MonitorFactoryInterface
public Iterator iterator()
iterator
in interface MonitorFactoryInterface
public Map getMap()
MonitorFactoryInterface
getMap
in interface MonitorFactoryInterface
public void enableActivityTracking(boolean enable)
MonitorFactoryInterface
enableActivityTracking
in interface MonitorFactoryInterface
public boolean isActivityTrackingEnabled()
isActivityTrackingEnabled
in interface MonitorFactoryInterface
public int getMaxNumMonitors()
MonitorFactoryInterface
getMaxNumMonitors
in interface MonitorFactoryInterface
public void setMaxNumMonitors(int maxMonitors)
MonitorFactoryInterface
setMaxNumMonitors
in interface MonitorFactoryInterface
maxMonitors
- If positive then this is the max number of monitors that can be stored. 0 or negative means monitors can grow unbounded.public void enableTotalKeySizeTracking()
MonitorFactoryInterface
enableTotalKeySizeTracking
in interface MonitorFactoryInterface
public void disableTotalKeySizeTracking()
disableTotalKeySizeTracking
in interface MonitorFactoryInterface
public long getTotalKeySize()
getTotalKeySize
in interface MonitorFactoryInterface
public boolean isTotalKeySizeTrackingEnabled()
isTotalKeySizeTrackingEnabled
in interface MonitorFactoryInterface
public int getMaxSqlSize()
MonitorFactoryInterface
getMaxSqlSize
in interface MonitorFactoryInterface
public void addListeners(List<JamonPropertiesLoader.JamonListenerProperty> listeners)
MonitorFactoryInterface
addListeners
in interface MonitorFactoryInterface
public void setMaxSqlSize(int size)
MonitorFactoryInterface
setMaxSqlSize
in interface MonitorFactoryInterface
public FactoryDisabled copy()
copy
in interface MonitorFactoryInterface
Copyright © 2015. All rights reserved.