use of com.linkedin.databus2.core.container.monitoring.mbean.ContainerTrafficTotalStatsMBean in project databus by linkedin.
the class ContainerStatsRequestProcessor method processOutboundTrafficTotalStats.
private void processOutboundTrafficTotalStats(DatabusRequest request) throws IOException {
ContainerTrafficTotalStatsMBean outboundTrafficTotalStatsMBean = _containerStatsCollector.getOutboundTrafficTotalStats();
if (null == outboundTrafficTotalStatsMBean)
return;
// String json = outboundTrafficTotalStatsMBean.toJson();
JsonEncoder jsonEncoder = outboundTrafficTotalStatsMBean.createJsonEncoder(Channels.newOutputStream(request.getResponseContent()));
outboundTrafficTotalStatsMBean.toJson(jsonEncoder, null);
if (request.getRequestType() == HttpMethod.PUT || request.getRequestType() == HttpMethod.POST) {
enableOrResetStatsMBean(outboundTrafficTotalStatsMBean, request);
}
}
use of com.linkedin.databus2.core.container.monitoring.mbean.ContainerTrafficTotalStatsMBean in project databus by linkedin.
the class ContainerStatsRequestProcessor method processInboundTrafficTotalStats.
private void processInboundTrafficTotalStats(DatabusRequest request) throws IOException {
ContainerTrafficTotalStatsMBean inboundTrafficTotalStatsMBean = _containerStatsCollector.getInboundTrafficTotalStats();
if (null == inboundTrafficTotalStatsMBean)
return;
// String json = inboundTrafficTotalStatsMBean.toJson();
JsonEncoder jsonEncoder = inboundTrafficTotalStatsMBean.createJsonEncoder(Channels.newOutputStream(request.getResponseContent()));
inboundTrafficTotalStatsMBean.toJson(jsonEncoder, null);
if (request.getRequestType() == HttpMethod.PUT || request.getRequestType() == HttpMethod.POST) {
enableOrResetStatsMBean(inboundTrafficTotalStatsMBean, request);
}
}
Aggregations