|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.objectweb.cjdbc.controller.monitoring.Monitoring org.objectweb.cjdbc.controller.monitoring.SQLMonitoring
This class implements a SQL monitoring module.
Field Summary | |
private boolean |
defaultRule
|
private static Trace |
logger
|
private java.util.ArrayList |
ruleList
|
private java.util.Hashtable |
statList
|
Fields inherited from class org.objectweb.cjdbc.controller.monitoring.Monitoring |
active |
Fields inherited from interface org.objectweb.cjdbc.common.xml.XmlComponent |
DOCTYPE_CONTROLLER, DOCTYPE_DB, XML_VERSION |
Constructor Summary | |
SQLMonitoring(java.lang.String vdbName)
Create a SQLMonitoring object. |
Method Summary | |
void |
addRule(SQLMonitoringRule rule)
Add a rule to the list. |
void |
cleanStats()
Clean the content of statistics, to avoid memory problems. |
void |
dumpAllStatsInformation()
Dump all stats using the current logger (INFO level). |
java.lang.String[][] |
getAllStatsInformation()
Return all stats information in the form of a String |
boolean |
getDefaultRule()
Get the default monitoring rule |
java.util.ArrayList |
getRuleList()
|
Stats |
getStatForRequest(AbstractRequest request)
Retrieve the stat corresponding to a request and create it if it does not exist. |
java.lang.String |
getXmlImpl()
Get implementation information |
void |
logCacheHit(AbstractRequest request)
Log a cache hit for the given request. |
void |
logError(AbstractRequest request)
Log an error for the given request. |
void |
logRequestTime(AbstractRequest request,
long time)
Log the time elapsed to execute the given request. |
private java.lang.String |
monitorRequestRule(AbstractRequest request)
Check the rule list to check of this request should be monitored or not. |
void |
resetRequestStat(AbstractRequest request)
Reset the stats associated to a request. |
void |
setDefaultRule(boolean monitoring)
Defines the default rule |
Methods inherited from class org.objectweb.cjdbc.controller.monitoring.Monitoring |
getXml, isActive, setActive |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private java.util.Hashtable statList
private java.util.ArrayList ruleList
private boolean defaultRule
private static Trace logger
Constructor Detail |
public SQLMonitoring(java.lang.String vdbName)
vdbName
- name of the virtual database to be used by the loggerMethod Detail |
public void cleanStats()
Monitoring
cleanStats
in class Monitoring
Monitoring.cleanStats()
public final void logRequestTime(AbstractRequest request, long time)
request
- the request executedtime
- time elapsed to execute this requestpublic final void logError(AbstractRequest request)
request
- the request that failed to executepublic final void logCacheHit(AbstractRequest request)
request
- the request that failed to executepublic final void resetRequestStat(AbstractRequest request)
request
- the request to resetpublic final Stats getStatForRequest(AbstractRequest request)
request
- the request to look for
public java.lang.String[][] getAllStatsInformation()
getAllStatsInformation
in class Monitoring
public void dumpAllStatsInformation()
dumpAllStatsInformation
in class Monitoring
public boolean getDefaultRule()
public void setDefaultRule(boolean monitoring)
monitoring
- true if on, false is offpublic void addRule(SQLMonitoringRule rule)
rule
- the rule to addprivate java.lang.String monitorRequestRule(AbstractRequest request)
request
- the query to look for
public java.util.ArrayList getRuleList()
public java.lang.String getXmlImpl()
Monitoring
getXmlImpl
in class Monitoring
XmlComponent.getXml()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |