use of com.creditease.monitor.captureframework.spi.MonitorElementInstance in project uavstack by uavorg.
the class TomcatJdbcHookProxy method collectDBPoolMetrics.
@Override
protected void collectDBPoolMetrics(MonitorElement clientElem) {
if (this.datasources.size() == 0) {
return;
}
for (DataSource ds : this.datasources) {
String jdbcURL = (String) ReflectionHelper.invoke(ds.getClass().getName(), ds, "getUrl", null, null, ds.getClass().getClassLoader());
/**
* 匹配客户端应用
*/
MonitorElementInstance inst = this.matchElemInstance(clientElem, jdbcURL);
if (inst == null) {
continue;
}
collectDataSourceStat(inst, ds);
}
}
use of com.creditease.monitor.captureframework.spi.MonitorElementInstance in project uavstack by uavorg.
the class ConnectionPoolManagerDelegate method collectDataPools.
/**
* collectDataPools
*
* @param clientElem
* @param proxy
*/
public void collectDataPools(MonitorElement clientElem, AbsDBPoolHookProxy proxy) {
ConnectionPool[] cpList = ConnectionPoolManager.getInstance().getConnectionPools();
if (cpList == null || cpList.length == 0) {
return;
}
for (ConnectionPool cp : cpList) {
String jdbcURL = cp.getDefinition().getUrl();
/**
* 匹配客户端应用
*/
MonitorElementInstance inst = proxy.matchElemInstance(clientElem, jdbcURL);
if (inst == null) {
continue;
}
collectDataSourceStat(inst, cp);
}
}
use of com.creditease.monitor.captureframework.spi.MonitorElementInstance in project uavstack by uavorg.
the class C3P0HookProxy method collectDBPoolMetrics.
@SuppressWarnings("rawtypes")
@Override
public void collectDBPoolMetrics(MonitorElement clientElem) {
Set dsList = C3P0Registry.getPooledDataSources();
if (dsList == null || dsList.size() == 0) {
return;
}
/**
* Step 2: 匹配对应的jdbc url
*/
for (Object ds : dsList) {
if (!ComboPooledDataSource.class.isAssignableFrom(ds.getClass())) {
continue;
}
ComboPooledDataSource pds = (ComboPooledDataSource) ds;
String jdbcURL = pds.getJdbcUrl();
/**
* 匹配客户端应用
*/
MonitorElementInstance inst = this.matchElemInstance(clientElem, jdbcURL);
if (inst == null) {
continue;
}
collectDataSourceStat(inst, pds);
}
}
use of com.creditease.monitor.captureframework.spi.MonitorElementInstance in project uavstack by uavorg.
the class HikariHookProxy method collectDBPoolMetrics.
@Override
protected void collectDBPoolMetrics(MonitorElement clientElem) {
if (this.datasources.size() == 0) {
return;
}
for (DataSource cp : this.datasources) {
String jdbcURL = (String) ReflectionHelper.invoke(cp.getClass().getName(), cp, "getJdbcUrl", null, null, cp.getClass().getClassLoader());
/**
* ƥ��ͻ���Ӧ��
*/
MonitorElementInstance inst = this.matchElemInstance(clientElem, jdbcURL);
if (inst == null) {
continue;
}
collectDataSourceStat(inst, cp);
}
}
use of com.creditease.monitor.captureframework.spi.MonitorElementInstance in project uavstack by uavorg.
the class MybatisHookProxy method collectDBPoolMetrics.
@Override
protected void collectDBPoolMetrics(MonitorElement clientElem) {
if (this.datasources.size() == 0) {
return;
}
for (DataSource cp : this.datasources) {
String jdbcURL = (String) ReflectionHelper.invoke(cp.getClass().getName(), cp, "getUrl", null, null, cp.getClass().getClassLoader());
MonitorElementInstance inst = this.matchElemInstance(clientElem, jdbcURL);
if (inst == null) {
continue;
}
collectDataSourceStat(inst, cp);
}
}
Aggregations