| Modifier and Type | Class and Description |
|---|---|
| public static class | |
| public static class | SlowQueryReport.
Compare QueryStats by their lastInvocation value. |
| Modifier and Type | Field and Description |
|---|---|
| private static final Log | |
| protected boolean | logFailed
Flag to enable disable logging of failed queries |
| protected boolean | logSlow
Flag to enable disable logging of slow queries |
| protected int | maxQueries
Maximum number of queries we will be storing |
| protected static final ConcurrentHashMap | perPoolStats
we will be keeping track of query stats on a per pool basis |
| protected volatile ConcurrentHashMap | queries
the queries that are used for this interceptor. |
| protected final Comparator | queryStatsComparator
Sort QueryStats by last invocation time |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | closeInvoked()
Implements abstract org. invoked when the connection receives the close request Not used for now. |
| public static ConcurrentHashMap | Returns: a hash map containing statistics for 0 to maxQueries- the name of the pool we want to retrieve stats for poolname)Returns the query stats for a given pool |
| protected SlowQueryReport. | |
| public boolean | |
| public boolean | |
| public void | poolClosed(ConnectionPool
- the pool that is being closed. pool)Overrides org. This method is invoked by a connection pool when the pool is closed. |
| public void | poolStarted(ConnectionPool
- the pool that is being closed. pool)Overrides org. This method is invoked by a connection pool when the pool is first started up, usually when the first connection is requested. |
| public void | prepareCall(String
- the string used to prepare the statement with sql, long - the time it took to invoke prepare time)Implements abstract org. Invoked when prepareCall has been called and completed. |
| public void | prepareStatement(String
- the string used to prepare the statement with sql, long - the time it took to invoke prepare time)Implements abstract org. Invoked when prepareStatement has been called and completed. |
| protected void | removeOldest(ConcurrentHashMap<String, SlowQueryReport.
The queries map queriesSort QueryStats by last invocation time |
| protected String | reportFailedQuery(String
the query that was executed and failed query, Object[] the arguments to the execution args, String the name of the method used to execute name, long AbstractCreateStatementInterceptor#isExecute(Method, boolean)the time the query execution started start, Throwable the exception that happened t)Overrides org. Invoked when a query execution, a call to execute/executeQuery or executeBatch failed. |
| protected String | reportQuery(String
the query that was executed and failed query, Object[] the arguments to the execution args, final String the name of the method used to execute name, long AbstractCreateStatementInterceptor#isExecute(Method, boolean)the time the query execution started start, long the time the execution took delta)Overrides org. Invoked when a query execution, a call to execute/executeQuery or executeBatch succeeded and was within the timing threshold |
| protected String | reportSlowQuery(String
the query that was executed and failed query, Object[] the arguments to the execution args, String the name of the method used to execute name, long AbstractCreateStatementInterceptor#isExecute(Method, boolean)the time the query execution started start, long the time the execution took delta)Overrides org. Invoked when a query execution, a call to execute/executeQuery or executeBatch succeeded and was exceeded the timing threshold |
| public void | reset(ConnectionPool
- the connection pool owning the connection parent, PooledConnection - the pooled connection con)Overrides org. no-op for this interceptor. |
| public void | |
| public void | |
| public void | |
| public void | setProperties(Map<String, PoolProperties.
The properties propertiesOverrides org. Called during the creation of an interceptor The properties can be set during the configuration of an interceptor Override this method to perform type casts between string values and object properties |
| log | back to summary |
|---|---|
| private static final Log log Hides org. | |
| logFailed | back to summary |
|---|---|
| protected boolean logFailed Flag to enable disable logging of failed queries | |
| logSlow | back to summary |
|---|---|
| protected boolean logSlow Flag to enable disable logging of slow queries | |
| maxQueries | back to summary |
|---|---|
| protected int maxQueries Maximum number of queries we will be storing | |
| perPoolStats | back to summary |
|---|---|
| protected static final ConcurrentHashMap<String, ConcurrentHashMap<String, SlowQueryReport. we will be keeping track of query stats on a per pool basis | |
| queries | back to summary |
|---|---|
| protected volatile ConcurrentHashMap<String, SlowQueryReport. the queries that are used for this interceptor. | |
| queryStatsComparator | back to summary |
|---|---|
| protected final Comparator<SlowQueryReport. Sort QueryStats by last invocation time | |
| SlowQueryReport | back to summary |
|---|---|
| public SlowQueryReport() Creates a slow query report interceptor | |
| closeInvoked | back to summary |
|---|---|
| public void closeInvoked() Implements abstract org. invoked when the connection receives the close request Not used for now.
| |
| getPoolStats | back to summary |
|---|---|
| public static ConcurrentHashMap Returns the query stats for a given pool
| |
| getQueryStats | back to summary |
|---|---|
| protected SlowQueryReport. | |
| isLogFailed | back to summary |
|---|---|
| public boolean isLogFailed() | |
| isLogSlow | back to summary |
|---|---|
| public boolean isLogSlow() | |
| poolClosed | back to summary |
|---|---|
| public void poolClosed(ConnectionPool pool) Overrides org. Doc from org. This method is invoked by a connection pool when the pool is closed. Interceptor classes can override this method if they keep static variables or other tracking means around. This method is only invoked on a single instance of the interceptor, and not on every instance created.
| |
| poolStarted | back to summary |
|---|---|
| public void poolStarted(ConnectionPool pool) Overrides org. Doc from org. This method is invoked by a connection pool when the pool is first started up, usually when the first connection is requested. Interceptor classes can override this method if they keep static variables or other tracking means around. This method is only invoked on a single instance of the interceptor, and not on every instance created.
| |
| prepareCall | back to summary |
|---|---|
| public void prepareCall(String sql, long time) Implements abstract org. Doc from org. Invoked when prepareCall has been called and completed. | |
| prepareStatement | back to summary |
|---|---|
| public void prepareStatement(String sql, long time) Implements abstract org. Doc from org. Invoked when prepareStatement has been called and completed. | |
| removeOldest | back to summary |
|---|---|
| protected void removeOldest(ConcurrentHashMap<String, SlowQueryReport. Sort QueryStats by last invocation time
| |
| reportFailedQuery | back to summary |
|---|---|
| protected String reportFailedQuery(String query, Object[] args, String name, long start, Throwable t) Overrides org. Doc from org. Invoked when a query execution, a call to execute/executeQuery or executeBatch failed.
| |
| reportQuery | back to summary |
|---|---|
| protected String reportQuery(String query, Object[] args, final String name, long start, long delta) Overrides org. Doc from org. Invoked when a query execution, a call to execute/executeQuery or executeBatch succeeded and was within the timing threshold
| |
| reportSlowQuery | back to summary |
|---|---|
| protected String reportSlowQuery(String query, Object[] args, String name, long start, long delta) Overrides org. Doc from org. Invoked when a query execution, a call to execute/executeQuery or executeBatch succeeded and was exceeded the timing threshold
| |
| reset | back to summary |
|---|---|
| public void reset(ConnectionPool parent, PooledConnection con) Overrides org. Doc from org. no-op for this interceptor. no state is stored.
| |
| setLogFailed | back to summary |
|---|---|
| public void setLogFailed(boolean logFailed) | |
| setLogSlow | back to summary |
|---|---|
| public void setLogSlow(boolean logSlow) | |
| setMaxQueries | back to summary |
|---|---|
| public void setMaxQueries(int maxQueries) | |
| setProperties | back to summary |
|---|---|
| public void setProperties(Map<String, PoolProperties. Overrides org. Doc from org. Called during the creation of an interceptor The properties can be set during the configuration of an interceptor Override this method to perform type casts between string values and object properties
| |
| Modifier and Type | Field and Description |
|---|---|
| private volatile long | |
| pack-priv static final String[] | |
| pack-priv static final String[] | |
| pack-priv static final OpenType | |
| private volatile long | |
| private volatile long | |
| private volatile long | |
| private volatile long | |
| private volatile long | |
| private volatile int | |
| private volatile int | |
| private volatile long | |
| private final String | |
| private volatile long |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public synchronized void | |
| public boolean | equals(Object
the reference object with which to compare. other)Overrides java. Indicates whether some other object is "equal to" this one. |
| public synchronized void | |
| public CompositeDataSupport | |
| public static String[] | |
| public static String[] | |
| public static OpenType | |
| public long | |
| public long | |
| public long | |
| public long | |
| public int | |
| public String | |
| public long | |
| public int | |
| public boolean | |
| public synchronized void | |
| public String |
| failures | back to summary |
|---|---|
| private volatile long failures | |
| FIELD_DESCRIPTIONS | back to summary |
|---|---|
| pack-priv static final String[] FIELD_DESCRIPTIONS | |
| FIELD_NAMES | back to summary |
|---|---|
| pack-priv static final String[] FIELD_NAMES | |
| FIELD_TYPES | back to summary |
|---|---|
| pack-priv static final OpenType<?>[] FIELD_TYPES | |
| lastInvocation | back to summary |
|---|---|
| private volatile long lastInvocation | |
| maxInvocationDate | back to summary |
|---|---|
| private volatile long maxInvocationDate | |
| maxInvocationTime | back to summary |
|---|---|
| private volatile long maxInvocationTime | |
| minInvocationDate | back to summary |
|---|---|
| private volatile long minInvocationDate | |
| minInvocationTime | back to summary |
|---|---|
| private volatile long minInvocationTime | |
| nrOfInvocations | back to summary |
|---|---|
| private volatile int nrOfInvocations | |
| prepareCount | back to summary |
|---|---|
| private volatile int prepareCount | |
| prepareTime | back to summary |
|---|---|
| private volatile long prepareTime | |
| query | back to summary |
|---|---|
| private final String query | |
| totalInvocationTime | back to summary |
|---|---|
| private volatile long totalInvocationTime | |
| QueryStats | back to summary |
|---|---|
| public QueryStats(String query) | |
| add | back to summary |
|---|---|
| public synchronized void add(long invocationTime, long now) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object other) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| failure | back to summary |
|---|---|
| public synchronized void failure(long invocationTime, long now) | |
| getCompositeData | back to summary |
|---|---|
| public CompositeDataSupport getCompositeData(final CompositeType type) throws OpenDataException | |
| getFieldDescriptions | back to summary |
|---|---|
| public static String[] getFieldDescriptions() | |
| getFieldNames | back to summary |
|---|---|
| public static String[] getFieldNames() | |
| getFieldTypes | back to summary |
|---|---|
| public static OpenType | |
| getMaxInvocationDate | back to summary |
|---|---|
| public long getMaxInvocationDate() | |
| getMaxInvocationTime | back to summary |
|---|---|
| public long getMaxInvocationTime() | |
| getMinInvocationDate | back to summary |
|---|---|
| public long getMinInvocationDate() | |
| getMinInvocationTime | back to summary |
|---|---|
| public long getMinInvocationTime() | |
| getNrOfInvocations | back to summary |
|---|---|
| public int getNrOfInvocations() | |
| getQuery | back to summary |
|---|---|
| public String getQuery() | |
| getTotalInvocationTime | back to summary |
|---|---|
| public long getTotalInvocationTime() | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| isOlderThan | back to summary |
|---|---|
| public boolean isOlderThan(SlowQueryReport. | |
| prepare | back to summary |
|---|---|
| public synchronized void prepare(long invocationTime) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
0 which should
be handled as the newest possible invocation.
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public int | compare(SlowQueryReport.
the first object to be compared. stats1,the second object to be compared. stats2Implements java. Compares its two arguments for order. |
| private static long |
| QueryStatsComparator | back to summary |
|---|---|
| public QueryStatsComparator() | |
| compare | back to summary |
|---|---|
| public int compare(SlowQueryReport. Implements java. Doc from java. Compares its two arguments for order. Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
The implementor must ensure that
The implementor must also ensure that the relation is transitive:
Finally, the implementor must ensure that
| |
| handleZero | back to summary |
|---|---|
| private static long handleZero(long value) | |