Package org.apache.kafka.common.metrics.stats

Examples of org.apache.kafka.common.metrics.stats.Rate


            this.requestTimeSensor = metrics.sensor("request-time");
            this.requestTimeSensor.add("request-latency-avg", "The average request latency in ms", new Avg());
            this.requestTimeSensor.add("request-latency-max", "The maximum request latency in ms", new Max());

            this.recordsPerRequestSensor = metrics.sensor("records-per-request");
            this.recordsPerRequestSensor.add("record-send-rate", "The average number of records sent per second.", new Rate());
            this.recordsPerRequestSensor.add("records-per-request-avg", "The average number of records per request.", new Avg());

            this.retrySensor = metrics.sensor("record-retries");
            this.retrySensor.add("record-retry-rate", "The average per-second number of retried record sends", new Rate());

            this.errorSensor = metrics.sensor("errors");
            this.errorSensor.add("record-error-rate", "The average per-second number of record sends that resulted in errors", new Rate());

            this.maxRecordSizeSensor = metrics.sensor("record-size-max");
            this.maxRecordSizeSensor.add("record-size-max", "The maximum record size", new Max());
            this.maxRecordSizeSensor.add("record-size-avg", "The average record size", new Avg());
View Full Code Here


            // then all other sensors should have been registered; and vice versa
            String topicRecordsCountName = "topic." + topic + ".records-per-batch";
            Sensor topicRecordCount = this.metrics.getSensor(topicRecordsCountName);
            if (topicRecordCount == null) {
                topicRecordCount = this.metrics.sensor(topicRecordsCountName);
                topicRecordCount.add("topic." + topic + ".record-send-rate", new Rate());

                String topicByteRateName = "topic." + topic + ".bytes";
                Sensor topicByteRate = this.metrics.sensor(topicByteRateName);
                topicByteRate.add("topic." + topic + ".byte-rate", new Rate());

                String topicCompressionRateName = "topic." + topic + ".compression-rate";
                Sensor topicCompressionRate = this.metrics.sensor(topicCompressionRateName);
                topicCompressionRate.add("topic." + topic + ".compression-rate", new Avg());

                String topicRetryName = "topic." + topic + ".record-retries";
                Sensor topicRetrySensor = this.metrics.sensor(topicRetryName);
                topicRetrySensor.add("topic." + topic + ".record-retry-rate", new Rate());

                String topicErrorName = "topic." + topic + ".record-errors";
                Sensor topicErrorSensor = this.metrics.sensor(topicErrorName);
                topicErrorSensor.add("topic." + topic + ".record-error-rate", new Rate());
            }
        }
View Full Code Here

        this.metrics = metrics;
        this.time = time;
        this.waitTime = this.metrics.sensor("bufferpool-wait-time");
        this.waitTime.add("bufferpool-wait-ratio",
                          "The fraction of time an appender waits for space allocation.",
                          new Rate(TimeUnit.NANOSECONDS));
   }
View Full Code Here

        public SelectorMetrics(Metrics metrics) {
            this.metrics = metrics;

            this.connectionClosed = this.metrics.sensor("connections-closed");
            this.connectionClosed.add("connection-close-rate", "Connections closed per second in the window.", new Rate());

            this.connectionCreated = this.metrics.sensor("connections-created");
            this.connectionCreated.add("connection-creation-rate", "New connections established per second in the window.", new Rate());

            this.bytesTransferred = this.metrics.sensor("bytes-sent-received");
            bytesTransferred.add("network-io-rate",
                                 "The average number of network operations (reads or writes) on all connections per second.",
                                 new Rate(new Count()));

            this.bytesSent = this.metrics.sensor("bytes-sent", bytesTransferred);
            this.bytesSent.add("outgoing-byte-rate", "The average number of outgoing bytes sent per second to all servers.", new Rate());
            this.bytesSent.add("request-rate", "The average number of requests sent per second.", new Rate(new Count()));
            this.bytesSent.add("request-size-avg", "The average size of all requests in the window..", new Avg());
            this.bytesSent.add("request-size-max", "The maximum size of any request sent in the window.", new Max());

            this.bytesReceived = this.metrics.sensor("bytes-received", bytesTransferred);
            this.bytesReceived.add("incoming-byte-rate", "Bytes/second read off all sockets", new Rate());
            this.bytesReceived.add("response-rate", "Responses received sent per second.", new Rate(new Count()));

            this.selectTime = this.metrics.sensor("select-time");
            this.selectTime.add("select-rate",
                                "Number of times the I/O layer checked for new I/O to perform per second",
                                new Rate(new Count()));
            this.selectTime.add("io-wait-time-ns-avg",
                                "The average length of time the I/O thread spent waiting for a socket ready for reads or writes in nanoseconds.",
                                new Avg());
            this.selectTime.add("io-wait-ratio", "The fraction of time the I/O thread spent waiting.", new Rate(TimeUnit.NANOSECONDS));

            this.ioTime = this.metrics.sensor("io-time");
            this.ioTime.add("io-time-ns-avg", "The average length of time for I/O per select call in nanoseconds.", new Avg());
            this.ioTime.add("io-ratio", "The fraction of time the I/O thread spent doing I/O", new Rate(TimeUnit.NANOSECONDS));

            this.metrics.addMetric("connection-count", "The current number of active connections.", new Measurable() {
                public double measure(MetricConfig config, long now) {
                    return keys.size();
                }
View Full Code Here

                // then all other sensors should have been registered; and vice versa
                String nodeRequestName = "node-" + node + ".bytes-sent";
                Sensor nodeRequest = this.metrics.getSensor(nodeRequestName);
                if (nodeRequest == null) {
                    nodeRequest = this.metrics.sensor(nodeRequestName);
                    nodeRequest.add("node-" + node + ".outgoing-byte-rate", new Rate());
                    nodeRequest.add("node-" + node + ".request-rate",
                                    "The average number of requests sent per second.",
                                    new Rate(new Count()));
                    nodeRequest.add("node-" + node + ".request-size-avg", "The average size of all requests in the window..", new Avg());
                    nodeRequest.add("node-" + node + ".request-size-max", "The maximum size of any request sent in the window.", new Max());

                    String nodeResponseName = "node-" + node + ".bytes-received";
                    Sensor nodeResponse = this.metrics.sensor(nodeResponseName);
                    nodeResponse.add("node-" + node + ".incoming-byte-rate", new Rate());
                    nodeResponse.add("node-" + node + ".response-rate",
                                     "The average number of responses received per second.",
                                     new Rate(new Count()));

                    String nodeTimeName = "node-" + node + ".latency";
                    Sensor nodeRequestTime = this.metrics.sensor(nodeTimeName);
                    nodeRequestTime.add("node-" + node + ".request-latency-avg", new Avg());
                    nodeRequestTime.add("node-" + node + ".request-latency-max", new Max());
View Full Code Here

        metrics.addMetric("direct.measurable", measurable);
        Sensor s = metrics.sensor("test.sensor");
        s.add("test.avg", new Avg());
        s.add("test.max", new Max());
        s.add("test.min", new Min());
        s.add("test.rate", new Rate(TimeUnit.SECONDS));
        s.add("test.occurences", new Rate(TimeUnit.SECONDS, new Count()));
        s.add("test.count", new Count());
        s.add(new Percentiles(100, -100, 100, BucketSizing.CONSTANT, new Percentile("test.median", 50.0), new Percentile("test.perc99_9",
                                                                                                                         99.9)));

        Sensor s2 = metrics.sensor("test.sensor2");
View Full Code Here

TOP

Related Classes of org.apache.kafka.common.metrics.stats.Rate

Copyright © 2018 www.massapicom. 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.