Package org.apache.kafka.common.metrics

Examples of org.apache.kafka.common.metrics.Sensor.record()


                        maybeRegisterTopicMetrics(topic);

                        // per-topic record send rate
                        String topicRecordsCountName = "topic." + topic + ".records-per-batch";
                        Sensor topicRecordCount = Utils.notNull(this.metrics.getSensor(topicRecordsCountName));
                        topicRecordCount.record(batch.recordCount);

                        // per-topic bytes send rate
                        String topicByteRateName = "topic." + topic + ".bytes";
                        Sensor topicByteRate = Utils.notNull(this.metrics.getSensor(topicByteRateName));
                        topicByteRate.record(batch.records.sizeInBytes());
View Full Code Here


                        topicRecordCount.record(batch.recordCount);

                        // per-topic bytes send rate
                        String topicByteRateName = "topic." + topic + ".bytes";
                        Sensor topicByteRate = Utils.notNull(this.metrics.getSensor(topicByteRateName));
                        topicByteRate.record(batch.records.sizeInBytes());

                        // per-topic compression rate
                        String topicCompressionRateName = "topic." + topic + ".compression-rate";
                        Sensor topicCompressionRate = Utils.notNull(this.metrics.getSensor(topicCompressionRateName));
                        topicCompressionRate.record(batch.records.compressionRate());
View Full Code Here

                        topicByteRate.record(batch.records.sizeInBytes());

                        // per-topic compression rate
                        String topicCompressionRateName = "topic." + topic + ".compression-rate";
                        Sensor topicCompressionRate = Utils.notNull(this.metrics.getSensor(topicCompressionRateName));
                        topicCompressionRate.record(batch.records.compressionRate());

                        // global metrics
                        this.batchSizeSensor.record(batch.records.sizeInBytes(), now);
                        this.queueTimeSensor.record(batch.drainedMs - batch.createdMs, now);
                        this.compressionRateSensor.record(batch.records.compressionRate());
View Full Code Here

            long now = time.milliseconds();
            this.retrySensor.record(count, now);
            String topicRetryName = "topic." + topic + ".record-retries";
            Sensor topicRetrySensor = this.metrics.getSensor(topicRetryName);
            if (topicRetrySensor != null)
                topicRetrySensor.record(count, now);
        }

        public void recordErrors(String topic, int count) {
            long now = time.milliseconds();
            this.errorSensor.record(count, now);
View Full Code Here

            long now = time.milliseconds();
            this.errorSensor.record(count, now);
            String topicErrorName = "topic." + topic + ".record-errors";
            Sensor topicErrorSensor = this.metrics.getSensor(topicErrorName);
            if (topicErrorSensor != null)
                topicErrorSensor.record(count, now);
        }

        public void recordLatency(int node, long latency) {
            long now = time.milliseconds();
            this.requestTimeSensor.record(latency, now);
View Full Code Here

            this.requestTimeSensor.record(latency, now);
            if (node >= 0) {
                String nodeTimeName = "node-" + node + ".latency";
                Sensor nodeRequestTime = this.metrics.getSensor(nodeTimeName);
                if (nodeRequestTime != null)
                    nodeRequestTime.record(latency, now);
            }
        }
    }

}
View Full Code Here

            this.bytesSent.record(bytes, now);
            if (node >= 0) {
                String nodeRequestName = "node-" + node + ".bytes-sent";
                Sensor nodeRequest = this.metrics.getSensor(nodeRequestName);
                if (nodeRequest != null)
                    nodeRequest.record(bytes, now);
            }
        }

        public void recordBytesReceived(int node, int bytes) {
            long now = time.milliseconds();
View Full Code Here

            this.bytesReceived.record(bytes, now);
            if (node >= 0) {
                String nodeRequestName = "node-" + node + ".bytes-received";
                Sensor nodeRequest = this.metrics.getSensor(nodeRequestName);
                if (nodeRequest != null)
                    nodeRequest.record(bytes, now);
            }
        }
    }

}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.