public interface JdbcMXBean
org.javasimon.jdbc4
). There is prefix of this hierarchy that is associated with
one instance of monitored JDBC driver. Typically, there is only one driver instance used
in application, because of connection to one type of database. If application is connected
to different types of database (i.e. oracle and mysql), there is possibility to differentiate
each used driver by specifying Simon hierarchy prefix for driver.JdbcMXBeanImpl.JdbcMXBeanImpl(org.javasimon.Manager, String)
)
or later through setter (setPrefix(String)
). Then is also possible to register Jdbc mxbean
for each prefix.
Monitoring of the JDBC driver is enabled only if Java Simon JDBC proxy driver is used
over original JDBC driver (eg. Oracle, PostgreSQL, MySQL etc.). For more details how to do
that, please look at Driver
a package org.javasimon.jdbc4
javadoc.JdbcMXBeanImpl
Modifier and Type | Method and Description |
---|---|
JdbcObjectInfo |
connectionsStat()
Retrieves summary data about JDBC connection objects.
|
void |
disableMonitoring()
Disables monitoring (gathering statistics) by associated JDBC Simon hierarchy, see
(
org.javasimon.jdbc ). |
void |
enableMonitoring()
Enables monitoring (gathering statistics) by associated JDBC Simon hierarchy, see
(
org.javasimon.jdbc ). |
String |
getPrefix()
Returns actual prefix associated with mxbean.
|
String[] |
getSqlCommands()
Returns SQL command types (
select , insert , delete , etc). |
StopwatchSample |
getSqlCommandStat(String cmd)
Retrieves summary data about all executed SQL commands of eneterd type (for instance
summary data of all executed selects).
|
String[] |
getSqls(String cmd)
Returns hashs of different SQL commands of one type (
select , insert ,
delete , etc). |
StopwatchSample |
getSqlStat(String sql)
Retrieves summary data about all same executed SQLs (for instance
summary data of all executed
select * from foo where bar => 0 ). |
boolean |
isMonitoringEnabled()
Returns state of monitoring JDBC driver.
|
JdbcObjectInfo |
resultsetsStat()
Retrieves summary data about JDBC result set objects.
|
void |
setPrefix(String value)
Sets custom prefix of JDBC Simon hierarchy, see more
JdbcMXBean . |
JdbcObjectInfo |
statementsStat()
Retrieves summary data about JDBC statement objects.
|
void setPrefix(String value)
JdbcMXBean
.value
- new prefixvoid enableMonitoring()
org.javasimon.jdbc
). Works if SimonManager is enabled, look
SimonManager.isEnabled()
.void disableMonitoring()
org.javasimon.jdbc
). If SimonManager is already disabled has no effect,
look SimonManager.disable()
.boolean isMonitoringEnabled()
true
if associated prefix is enabled; otherwise false
JdbcObjectInfo connectionsStat()
JdbcObjectInfo
JdbcObjectInfo statementsStat()
JdbcObjectInfo
JdbcObjectInfo resultsetsStat()
JdbcObjectInfo
String[] getSqlCommands()
select
, insert
, delete
, etc).
If client application uses DDL commands like create
, alter
and other,
those are included too. Special case are batch-es, they are referenced as batch
.getSqlCommandStat(String)
,
getSqls(String)
StopwatchSample getSqlCommandStat(String cmd)
cmd
- SQL command typeStopwatchSample
, or null
if
entered sql command type has no associated javasimon (it means, no sql of this type was
executed yet, for instance no update was executed yet)connectionsStat()
String[] getSqls(String cmd)
select
, insert
,
delete
, etc). Each hash represent one sql command with (and its many executions).cmd
- cmd SQL command type (select
, insert
, delete
, etc)getSqlCommands()
,
getSqlStat(String)
StopwatchSample getSqlStat(String sql)
select * from foo where bar => 0
).sql
- hash code of sql commandStopwatchSample
, or null
if
entered sql has no associated javasimon (it means, no sql like this was executed yet,
for instance no update was executed yet)getSqls(String)
Copyright © 2019. All rights reserved.