use of com.dtp.common.config.DtpProperties in project dynamic-tp by lyh200.
the class DtpWebCollectListener method onApplicationEvent.
@Override
public void onApplicationEvent(CollectEvent event) {
DtpProperties dtpProperties = event.getDtpProperties();
if (!dtpProperties.isEnabledCollect()) {
return;
}
try {
WebServerTpHandler webServerTpHandler = ApplicationContextHolder.getBean(WebServerTpHandler.class);
ThreadPoolStats poolStats = webServerTpHandler.getPoolStats();
if (poolStats == null) {
return;
}
CollectorHandler.getInstance().collect(poolStats, dtpProperties.getCollectorType());
} catch (Exception e) {
log.error("DynamicTp monitor, collect web server thread pool metrics failed.", e);
}
}
Aggregations