use of org.glassfish.jersey.server.monitoring.ResourceStatistics in project jersey by jersey.
the class MBeanExposer method onStatistics.
@Override
public void onStatistics(MonitoringStatistics statistics) {
if (domain == null) {
final String globalSubType = ",subType=" + PROPERTY_SUBTYPE_GLOBAL;
final ApplicationInfo appStats = applicationInfoProvider.get();
String appName = appStats.getResourceConfig().getApplicationName();
if (appName == null) {
appName = "App_" + Integer.toHexString(appStats.getResourceConfig().hashCode());
}
domain = "org.glassfish.jersey:type=" + appName;
unregisterJerseyMBeans(false);
uriStatsGroup = new ResourcesMBeanGroup(statistics.getUriStatistics(), true, this, ",subType=Uris");
Map<String, ResourceStatistics> newMap = transformToStringKeys(statistics.getResourceClassStatistics());
resourceClassStatsGroup = new ResourcesMBeanGroup(newMap, false, this, ",subType=Resources");
responseMXBean = new ResponseMXBeanImpl();
registerMBean(responseMXBean, globalSubType + ",global=Responses");
requestMBean = new ExecutionStatisticsDynamicBean(statistics.getRequestStatistics(), this, globalSubType, "AllRequestTimes");
exceptionMapperMXBean = new ExceptionMapperMXBeanImpl(statistics.getExceptionMapperStatistics(), this, globalSubType);
new ApplicationMXBeanImpl(appStats, this, globalSubType);
}
requestMBean.updateExecutionStatistics(statistics.getRequestStatistics());
uriStatsGroup.updateResourcesStatistics(statistics.getUriStatistics());
responseMXBean.updateResponseStatistics(statistics.getResponseStatistics());
exceptionMapperMXBean.updateExceptionMapperStatistics(statistics.getExceptionMapperStatistics());
this.resourceClassStatsGroup.updateResourcesStatistics(transformToStringKeys(statistics.getResourceClassStatistics()));
}
Aggregations