The DB Query Resource Adaptor creates several statistic parameter sets that can be monitored using the Rhino Stats tool.
Statistics parameter sets
The root parameter set is named DatabaseQuery
.entity-name
and has three child parameter sets:
The Query
parameter set has general statistics that are not specific to a given datasource. The DataSource
and
WorkerPool
parameter sets each have child parameter sets named for each datasource configured in the profiles, and
contain statistics specific to the datasource. The child parameter set uses the value of the Description
profile
attribute as its name.
A list of statistics with descriptions can be displayed with the rhino-stats -l
command:
Query
parameter set
This parameter set contains statistics relating to the overall execution of queries. Information such as the number of queries of a given type and the execution time including queuing and retries when failing over between datasources.
Parameter Set: /DatabaseQuery.dbquery-0.Query Parent Parameter Set: /DatabaseQuery.dbquery-0 Parameter Set Type: /ResourceAdaptorID[name=Database Query,vendor=OpenCloud,version=2.1].DatabaseQueryStats Description: Database Query RA statistics Counter type statistics: Id: Name: Short name: Label: Description: 0 activeSyncTxn activeSyncTxn n/a Active sync transactions 1 asyncQueries asyncQ n/a Total number of async queries 2 asyncTxnQueries asyncTxnQ n/a Total number of transactional async queries 3 asyncTxnUpdates asyncTxnU n/a Total number of transactional async updates 4 asyncUpdates asyncU n/a Total number of async updates 5 failed fail n/a Total number of query failures 6 syncQueries syncQ n/a Total number of sync queries 7 syncTxnQueries syncTxnQ n/a Total number of transactional sync queries 8 syncTxnUpdates syncTxnU n/a Total number of transactional sync updates 9 syncUpdates syncU n/a Total number of sync updates 10 txFailed txFail n/a Total number of failures during transaction end Sample type statistics: Id: Name: Short name: Label: Description: 11 commitTime commitT n/a Milliseconds taken to execute commit (including queue time) 12 failureTime failureT n/a Milliseconds taken by queries and other requests that failed (including retries and queue time) 13 queryTime queryT n/a Milliseconds taken to execute query (including retries and queue time) 14 rollbackTime rollbackT n/a Milliseconds taken to execute rollback (including queue time) 15 updateTime updateT n/a Milliseconds taken to execute update (including retries and queue time)
DataSource
parameter set
The individual data sources parameter sets under this parameter set contain statistics relating to a single data source. These report the execution status and time spent in each part of the execution sequence of queries, and the status of the connection pool.
Parameter Set: /DatabaseQuery.dbquery-0.DataSource Parent Parameter Set: /DatabaseQuery.dbquery-0 Parameter Set Type: /ResourceAdaptorID[name=Database Query,vendor=OpenCloud,version=2.1].DataSourceStats Description: Database Query RA DataSource statistics Counter type statistics: Id: Name: Short name: Label: Description: 0 closedIdle closeI n/a Total number of connections closed due to being idle 1 closedOld closeO n/a Total number of connections closed due to being too old 2 closedPoolMax closeP n/a Total number of connections closed due to pool max being exceeded 3 connectionsInProgress connecting n/a Total number of connection attempts that are in progress 4 databaseTimeout dbTimeout n/a Total number of query timeouts while waiting for database execution 5 getConnectionTimeout connTimeout n/a Total number of attempts to get a connection from the pool that timed out due to the pool timeout 6 inPool inPool n/a Number of available connections in the pool 7 inUse inUse n/a Number of connections in use 8 newConnectionCreated created n/a Total number of connections created 9 newConnectionFailure connectFail n/a Total number of connection attempts that failed (including timeouts) 10 newConnectionTimeout connectTimeout n/a Total number of connection attempts that failed due to a timeout 11 poolWaitTimeout pTimeout n/a Total number of query timeouts while waiting for a connection from the pool 12 pooledConnectionUsed used n/a Total number of pooled connections used 13 queueTimeout qTimeout n/a Total number of query timeouts while waiting for worker thread 14 resultTooLate late n/a Total number of ResultSets received too late (after query timeout) Sample type statistics: Id: Name: Short name: Label: Description: 15 connectionWait connWait n/a Milliseconds spent waiting for a connection from the pool (including establishing a new connection if needed) 16 databaseTimeCommit dbTimeC n/a Milliseconds spent calling commit 17 databaseTimeLate dbTimeL n/a Milliseconds spent creating and executing PreparedStatement that was abandoned after the query timeout 18 databaseTimeQuery dbTimeQ n/a Milliseconds spent creating and executing PreparedStatement for query 19 databaseTimeRollback dbTimeR n/a Milliseconds spent calling rollback 20 databaseTimeUpdate dbTimeU n/a Milliseconds spent creating and executing PreparedStatement for update 21 newConnectionTime newConnT n/a Milliseconds taken to establish a new connection to the database server 22 poolWait poolWait n/a Milliseconds spent waiting until a pooled connection is available (not including establishing a new connection). 23 queueTime queueTime n/a Milliseconds spent waiting in executor queue
The databaseTimeLate
statistic differs from the other databaseTimeX
statistics in that it records the time taken by all database tasks which completed after the execution timeout.
It is provided separately from the task specific time samples to assist in determining if there are database tasks that take an unusually long time to execute.
WorkerPool
parameter set
Thw worker pool parameter sets contain statistics relating to the pool of worker threads that perform database operations. Each data source has two worker pools - the main query execution thread pool and the connection pool management thread pool.
Parameter Set: /DatabaseQuery.dbquery-0.WorkerPool Parent Parameter Set: /DatabaseQuery.dbquery-0 Parameter Set Type: /ResourceAdaptorID[name=Database Query,vendor=OpenCloud,version=2.1].WorkerPoolStats Description: Database Query RA worker pool statistics Counter type statistics: Id: Name: Short name: Label: Description: 0 queueSize qSize n/a Number of tasks waiting in worker pool's queue 1 rejects rejects n/a Total number of tasks rejected because queue was full 2 tasksExecuted tasksTotal n/a Total number of tasks executed 3 threadsAvailable availThrd n/a Number of available worker threads 4 threadsTotal totalThrd n/a Total number of worker threads Sample type statistics: Id: Name: Short name: Label: Description: 5 processingTime procT n/a Milliseconds spent processing a task (internal processing time and database execution time) 6 queueTime queueT n/a Milliseconds spent in queue waiting for a thread