.attributeName("NumFetchRequests") .onException(Functions.constant(-1l)) .enabled(retrieveUsageMetrics)) .pollAttribute(new JmxAttributePollConfig<Long>(TOTAL_FETCH_TIME) .objectName(SOCKET_SERVER_STATS_MBEAN) .attributeName("TotalFetchRequestMs") .onException(Functions.constant(-1l)) .enabled(retrieveUsageMetrics)) .pollAttribute(new JmxAttributePollConfig<Double>(MAX_FETCH_TIME) .objectName(SOCKET_SERVER_STATS_MBEAN) .attributeName("MaxFetchRequestMs") .onException(Functions.constant(-1.0d)) .enabled(retrieveUsageMetrics)) .pollAttribute(new JmxAttributePollConfig<Long>(PRODUCE_REQUEST_COUNT) .objectName(SOCKET_SERVER_STATS_MBEAN) .attributeName("NumProduceRequests") .onException(Functions.constant(-1l)) .enabled(retrieveUsageMetrics)) .pollAttribute(new JmxAttributePollConfig<Long>(TOTAL_PRODUCE_TIME) .objectName(SOCKET_SERVER_STATS_MBEAN) .attributeName("TotalProduceRequestMs") .onException(Functions.constant(-1l)) .enabled(retrieveUsageMetrics)) .pollAttribute(new JmxAttributePollConfig<Double>(MAX_PRODUCE_TIME) .objectName(SOCKET_SERVER_STATS_MBEAN) .attributeName("MaxProduceRequestMs") .onException(Functions.constant(-1.0d)) .enabled(retrieveUsageMetrics)) .pollAttribute(new JmxAttributePollConfig<Long>(BYTES_RECEIVED)
.objectName(requestProcessorMbeanName) .attributeName("errorCount") .enabled(retrieveUsageMetrics)) .pollAttribute(new JmxAttributePollConfig<Integer>(REQUEST_COUNT) .objectName(requestProcessorMbeanName) .attributeName("requestCount") .onFailureOrException(EntityFunctions.attribute(this, REQUEST_COUNT)) .enabled(retrieveUsageMetrics)) .pollAttribute(new JmxAttributePollConfig<Integer>(TOTAL_PROCESSING_TIME) .objectName(requestProcessorMbeanName) .attributeName("processingTime") .enabled(retrieveUsageMetrics)) .build(); } else {
.objectName(requestProcessorMbeanName) .attributeName("errorCount") .enabled(retrieveUsageMetrics)) .pollAttribute(new JmxAttributePollConfig<Integer>(REQUEST_COUNT) .objectName(requestProcessorMbeanName) .attributeName("requestCount") .enabled(retrieveUsageMetrics) .onFailureOrException(EntityFunctions.attribute(this, REQUEST_COUNT))) .pollAttribute(new JmxAttributePollConfig<Integer>(TOTAL_PROCESSING_TIME) .objectName(requestProcessorMbeanName) .attributeName("processingTime") .enabled(retrieveUsageMetrics)) .build();