public class SimpleQueryProfiler extends Facultative implements SimpleQueryProfilerMBean, QueryProfiler
| Modifier and Type | Class and Description |
|---|---|
(package private) static class |
SimpleQueryProfiler.QueryInfo
The types of counters for each query
|
| Modifier and Type | Field and Description |
|---|---|
private java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.concurrent.atomic.AtomicLong>> |
queries
Accumulated values
|
| Constructor and Description |
|---|
SimpleQueryProfiler() |
| Modifier and Type | Method and Description |
|---|---|
long |
getQueryCount()
Retrieve the number of queries profiled
|
java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Long>> |
getValues()
Retrieve the values accumulated for each query.
|
void |
print(java.lang.String file)
Print the profiling numbers done for each query
|
void |
reset()
Reset profiling
|
java.lang.String |
toString(java.lang.String ts,
java.lang.String comment)
Simple implementation of toString.
|
void |
updateCacheHits(java.lang.String query,
long value)
Update the number of cache hits of a specified query
|
void |
updateCacheMisses(java.lang.String query,
long value)
Update the number of cache misses of a specified query
|
void |
updateHydrateTotalTime(java.lang.String query,
long value)
Update the number of nanoseconds spent in hydrate of a specified query
|
void |
updateRowsCount(java.lang.String query,
long value)
Update the number of rows retrieved from a result set
|
enable, getAnnotation, isEnabled, register, setAnnotationclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitenable, getAnnotation, isEnabled, setAnnotationprivate java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.concurrent.atomic.AtomicLong>> queries
public void updateRowsCount(java.lang.String query,
long value)
updateRowsCount in interface QueryProfilerquery - the query for which the update is donevalue - new valuepublic void updateCacheHits(java.lang.String query,
long value)
updateCacheHits in interface QueryProfilerquery - the query for which the update is donevalue - the number of cache hitspublic void updateCacheMisses(java.lang.String query,
long value)
updateCacheMisses in interface QueryProfilerquery - the query for which the update is donevalue - the number of cache missespublic void updateHydrateTotalTime(java.lang.String query,
long value)
updateHydrateTotalTime in interface QueryProfilerquery - the query for which the update is donevalue - the number of nanoseconds spent in hydratepublic java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Long>> getValues()
getValues in interface SimpleQueryProfilerMBeanpublic long getQueryCount()
getQueryCount in interface SimpleQueryProfilerMBeanpublic void reset()
reset in interface SimpleQueryProfilerMBeanpublic void print(java.lang.String file)
throws java.io.IOException
print in interface SimpleQueryProfilerMBeanfile - output file name (will be appended if exists)java.io.IOException - on I/O ERRORpublic java.lang.String toString(java.lang.String ts,
java.lang.String comment)
toString in interface QueryProfilerts - the timestampcomment - a specific comment