SQLMonitoring.java の 43 行で定義されています。
Public メソッド | |
SQLMonitoring (String vdbName) | |
final void | logRequestTime (AbstractRequest request, long time) |
final void | logError (AbstractRequest request) |
final void | logCacheHit (AbstractRequest request) |
final void | resetRequestStat (AbstractRequest request) |
final Stats | getStatForRequest (AbstractRequest request) |
String[][] | getAllStatsInformation () |
void | dumpAllStatsInformation () |
boolean | getDefaultRule () |
void | setDefaultRule (boolean monitoring) |
void | addRule (SQLMonitoringRule rule) |
ArrayList | getRuleList () |
String | getXmlImpl () |
String | getXml () |
Private メソッド | |
String | monitorRequestRule (AbstractRequest request) |
Private 変数 | |
Hashtable | statList |
ArrayList | ruleList |
boolean | defaultRule |
Static Private 変数 | |
Trace | logger = null |
|
Create a SQLMonitoring object.
SQLMonitoring.java の 56 行で定義されています。 参照先 org.objectweb.cjdbc.common.log.Trace.getLogger(), と org.objectweb.cjdbc.controller.monitoring.SQLMonitoring.statList.
|
|
Add a rule to the list.
SQLMonitoring.java の 210 行で定義されています。
00211 {
00212 this.ruleList.add(rule);
00213 }
|
|
Dump all stats using the current logger (INFO level). org.objectweb.cjdbc.controller.monitoring.Monitoringに実装されています. SQLMonitoring.java の 169 行で定義されています。 参照先 org.objectweb.cjdbc.common.log.Trace.info(), org.objectweb.cjdbc.common.log.Trace.isInfoEnabled(), org.objectweb.cjdbc.common.util.Stats.singleLineDisplay(), と org.objectweb.cjdbc.controller.monitoring.SQLMonitoring.statList.
|
|
Return all stats information in the form of a String
org.objectweb.cjdbc.controller.monitoring.Monitoringに実装されています. SQLMonitoring.java の 153 行で定義されています。 参照先 org.objectweb.cjdbc.controller.monitoring.SQLMonitoring.statList, と org.objectweb.cjdbc.common.util.Stats.toStringTable(). 参照元 org.objectweb.cjdbc.controller.monitoring.datacollector.DataCollector.retrieveSQLStats().
00154 { 00155 Collection values = statList.values(); 00156 String[][] result = new String[values.size()][]; 00157 int i = 0; 00158 for (Iterator iter = values.iterator(); iter.hasNext(); i++) 00159 { 00160 Stats stat = (Stats) iter.next(); 00161 result[i] = stat.toStringTable(); 00162 } 00163 return result; 00164 } |
|
Get the default monitoring rule
SQLMonitoring.java の 190 行で定義されています。 参照元 org.objectweb.cjdbc.controller.monitoring.SQLMonitoring.getXmlImpl().
00191 { 00192 return defaultRule; 00193 } |
|
SQLMonitoring.java の 252 行で定義されています。
00253 { 00254 return ruleList; 00255 } |
|
Retrieve the stat corresponding to a request and create it if it does not exist.
SQLMonitoring.java の 132 行で定義されています。 参照先 org.objectweb.cjdbc.controller.monitoring.SQLMonitoring.monitorRequestRule(), と org.objectweb.cjdbc.controller.monitoring.SQLMonitoring.statList. 参照元 org.objectweb.cjdbc.controller.monitoring.SQLMonitoring.logCacheHit(), org.objectweb.cjdbc.controller.monitoring.SQLMonitoring.logError(), org.objectweb.cjdbc.controller.monitoring.SQLMonitoring.logRequestTime(), と org.objectweb.cjdbc.controller.monitoring.SQLMonitoring.resetRequestStat().
00133 { 00134 String sql = monitorRequestRule(request); 00135 if (sql == null) 00136 return null; 00137 00138 // Note that the Hashtable is synchronized 00139 Stats stat = (Stats) statList.get(sql); 00140 if (stat == null) 00141 { // No entry for this query, create a new Stats entry 00142 stat = new Stats(sql); 00143 statList.put(sql, stat); 00144 } 00145 return stat; 00146 } |
|
Monitoring.java の 34 行で定義されています。 参照先 org.objectweb.cjdbc.controller.monitoring.Monitoring.getXmlImpl().
00035 { 00036 StringBuffer info = new StringBuffer(); 00037 info.append("<"+DatabasesXmlTags.ELT_Monitoring+">"); 00038 info.append(getXmlImpl()); 00039 info.append("</"+DatabasesXmlTags.ELT_Monitoring+">"); 00040 return info.toString(); 00041 } |
|
org.objectweb.cjdbc.controller.monitoring.Monitoringに実装されています. SQLMonitoring.java の 260 行で定義されています。 参照先 org.objectweb.cjdbc.controller.monitoring.SQLMonitoring.getDefaultRule().
00261 { 00262 String info = 00263 "<" 00264 + DatabasesXmlTags.ELT_SQLMonitoring 00265 + " " 00266 + DatabasesXmlTags.ATT_defaultMonitoring 00267 + "=\""; 00268 info += getDefaultRule(); 00269 info += "\">"; 00270 for (int i = 0; i < ruleList.size(); i++) 00271 { 00272 SQLMonitoringRule rule = (SQLMonitoringRule) ruleList.get(i); 00273 } 00274 info += "</" + DatabasesXmlTags.ELT_SQLMonitoring + ">"; 00275 return info; 00276 } |
|
Log a cache hit for the given request.
SQLMonitoring.java の 101 行で定義されています。 参照先 org.objectweb.cjdbc.common.log.Trace.debug(), org.objectweb.cjdbc.common.util.Stats.getName(), org.objectweb.cjdbc.controller.monitoring.SQLMonitoring.getStatForRequest(), org.objectweb.cjdbc.common.util.Stats.incrementCacheHit(), と org.objectweb.cjdbc.common.log.Trace.isDebugEnabled().
00102 { 00103 Stats stat = getStatForRequest(request); 00104 if (stat == null) 00105 return; 00106 stat.incrementCacheHit(); 00107 if (logger.isDebugEnabled()) 00108 logger.debug("Cache hit " + stat.getName()); 00109 } |
|
Log an error for the given request.
SQLMonitoring.java の 86 行で定義されています。 参照先 org.objectweb.cjdbc.common.log.Trace.debug(), org.objectweb.cjdbc.common.util.Stats.getName(), org.objectweb.cjdbc.controller.monitoring.SQLMonitoring.getStatForRequest(), org.objectweb.cjdbc.common.util.Stats.incrementError(), と org.objectweb.cjdbc.common.log.Trace.isDebugEnabled(). 参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.execReadRequest(), org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.execReadStoredProcedure(), org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.execWriteRequest(), と org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.execWriteRequestWithKeys().
00087 { 00088 Stats stat = getStatForRequest(request); 00089 if (stat == null) 00090 return; 00091 stat.incrementError(); 00092 if (logger.isDebugEnabled()) 00093 logger.debug("ERROR " + stat.getName()); 00094 } |
|
|
Check the rule list to check of this request should be monitored or not.
SQLMonitoring.java の 222 行で定義されています。 参照先 org.objectweb.cjdbc.common.sql.AbstractRequest.getSQL(), org.objectweb.cjdbc.common.sql.AbstractRequest.getSqlSkeleton(), org.objectweb.cjdbc.controller.monitoring.SQLMonitoringRule.isMonitoring(), と org.objectweb.cjdbc.controller.monitoring.SQLMonitoringRule.matches(). 参照元 org.objectweb.cjdbc.controller.monitoring.SQLMonitoring.getStatForRequest().
00223 { 00224 for (int i = 0; i < ruleList.size(); i++) 00225 { 00226 SQLMonitoringRule rule = (SQLMonitoringRule) ruleList.get(i); 00227 String sql = rule.matches(request); 00228 if (sql != null) 00229 { // This rule matches 00230 if (rule.isMonitoring()) 00231 return sql; 00232 else 00233 return null; 00234 } 00235 } 00236 00237 // No rule matched, use the default rule 00238 if (defaultRule) 00239 { 00240 if (request.getSqlSkeleton() == null) 00241 return request.getSQL(); 00242 else 00243 return request.getSqlSkeleton(); 00244 } 00245 else 00246 return null; 00247 } |
|
Reset the stats associated to a request.
SQLMonitoring.java の 116 行で定義されています。 参照先 org.objectweb.cjdbc.controller.monitoring.SQLMonitoring.getStatForRequest(), と org.objectweb.cjdbc.common.util.Stats.reset().
00117 { 00118 Stats stat = getStatForRequest(request); 00119 if (stat == null) 00120 return; 00121 stat.reset(); 00122 } |
|
Defines the default rule
SQLMonitoring.java の 200 行で定義されています。 参照元 org.objectweb.cjdbc.controller.xml.DatabasesParser.newSQLMonitoring().
00201 {
00202 this.defaultRule = monitoring;
00203 }
|
|
SQLMonitoring.java の 47 行で定義されています。 |
|
SQLMonitoring.java の 49 行で定義されています。 |
|
SQLMonitoring.java の 46 行で定義されています。 |
|
SQLMonitoring.java の 45 行で定義されています。 参照元 org.objectweb.cjdbc.controller.monitoring.SQLMonitoring.dumpAllStatsInformation(), org.objectweb.cjdbc.controller.monitoring.SQLMonitoring.getAllStatsInformation(), org.objectweb.cjdbc.controller.monitoring.SQLMonitoring.getStatForRequest(), と org.objectweb.cjdbc.controller.monitoring.SQLMonitoring.SQLMonitoring(). |