Examples of MetricsListResponse


Examples of org.graylog2.restclient.models.api.responses.metrics.MetricsListResponse

        requireJVMInfo();
        return jvmInfo;
    }

    public Map<String, Metric> getMetrics(String namespace) throws APIException, IOException {
        MetricsListResponse response = api.path(routes.MetricsResource().byNamespace(namespace), MetricsListResponse.class)
                .node(this)
                .expect(200)
                .execute();
        if (response == null) {
            return Collections.emptyMap();
        }
        return response.getMetrics();
    }
View Full Code Here

Examples of org.graylog2.restclient.models.api.responses.metrics.MetricsListResponse

                ioStats.writtenBytesTotal += asLong(written_bytes_total, metrics);
            }

            for (Radio radio : nodeService.radios().values()) {
                try {
                    final MetricsListResponse radioResponse = api
                            .path(routes.radio().MetricsResource().multipleMetrics(), MetricsListResponse.class)
                            .body(request)
                            .radio(radio)
                            .expect(200, 404)
                            .execute();
                    final Map<String, Metric> metrics = radioResponse.getMetrics();

                    ioStats.readBytes += asLong(read_bytes, metrics);
                    ioStats.readBytesTotal += asLong(read_bytes_total, metrics);
                    ioStats.writtenBytes += asLong(written_bytes, metrics);
                    ioStats.writtenBytesTotal += asLong(written_bytes_total, metrics);
View Full Code Here

Examples of org.graylog2.restclient.models.api.responses.metrics.MetricsListResponse

        }
        return 0;
    }

    public Map<String, Metric> getMetrics(String namespace) throws APIException, IOException {
        MetricsListResponse response = api.path(routes.radio().MetricsResource().byNamespace(namespace), MetricsListResponse.class)
                .radio(this)
                .expect(200, 404)
                .execute();

        return response.getMetrics();
    }
View Full Code Here

Examples of org.graylog2.restclient.models.api.responses.metrics.MetricsListResponse

        final String read_bytes_total = qualifiedIOMetricName("read_bytes", true);
        final String written_bytes = qualifiedIOMetricName("written_bytes", false);
        final String written_bytes_total = qualifiedIOMetricName("written_bytes", true);
        request.metrics = new String[] { read_bytes, read_bytes_total, written_bytes, written_bytes_total };
        try {
            final MetricsListResponse response = api.path(routes.MetricsResource().multipleMetrics(), MetricsListResponse.class)
                    .clusterEntity(node)
                    .body(request)
                    .expect(200, 404)
                    .execute();

            final Map<String,Metric> metrics = response.getMetrics();
            final IoStats ioStats = new IoStats();
            // these are all Gauges, if this ever changes almost everything is broken...
            ioStats.readBytes = asLong(read_bytes, metrics);
            ioStats.readBytesTotal = asLong(read_bytes_total, metrics);
            ioStats.writtenBytes = asLong(written_bytes, metrics);
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.