Examples of Metric


Examples of org.apache.kafka.common.Metric

                                            new Percentile("test.p50", 50),
                                            new Percentile("test.p75", 75));
        MetricConfig config = new MetricConfig().eventWindow(50).samples(2);
        Sensor sensor = metrics.sensor("test", config);
        sensor.add(percs);
        Metric p25 = this.metrics.metrics().get("test.p25");
        Metric p50 = this.metrics.metrics().get("test.p50");
        Metric p75 = this.metrics.metrics().get("test.p75");

        // record two windows worth of sequential values
        for (int i = 0; i < buckets; i++)
            sensor.record(i);

        assertEquals(25, p25.value(), 1.0);
        assertEquals(50, p50.value(), 1.0);
        assertEquals(75, p75.value(), 1.0);

        for (int i = 0; i < buckets; i++)
            sensor.record(0.0);

        assertEquals(0.0, p25.value(), 1.0);
        assertEquals(0.0, p50.value(), 1.0);
        assertEquals(0.0, p75.value(), 1.0);
    }
View Full Code Here

Examples of org.apache.muse.ws.dm.muws.Metric

            // a property is a metric IF it defines a Capability element in
            // its RMD definition with the Metrics capability URI
            //
            if (capability != null && capability.equals(MuwsConstants.METRICS_URI))
            {
                Metric metric = new SimpleMetric(qname, resource);
                _metricsByQName.put(qname, metric);
               
                //
                // on demand? update metadata before reads
                //
                if (metric.isOnDemand())
                    props.addReadListener(new MetricOnDemandListener(metric));
               
                //
                // add metric attributes for all reads
                //
                props.addReadListener(new MetricDecorationProvider(metric));
               
                //
                // update metadata whenever changes occur
                //
                props.addChangeListener(new MetricUpdateListener(metric));
               
                //
                // special case: counters that run on an interval can be
                // automated by starting a thread that increments the value
                // every N seconds
                //
                if (metric.isCounter() && metric.isInterval())
                {
                    Thread counter = new CounterThread(props, metric);
                    _countersByQName.put(qname, counter);
                    counter.start();
                }
View Full Code Here

Examples of org.apache.oodt.cas.resource.monitor.ganglia.configuration.Metric

     * ........
     * </EXTRA_DATA>
     * </METRIC>
     */
    public void testMetricTag() {
        Metric metric = ((((gridConfiguration.get(0)).getHosts()).get(0)).getMetrics()).get(0);
        assertEquals("disk_free", metric.getName());
        assertEquals("307.790", metric.getValue());
        assertEquals("double", metric.getType());
        assertEquals("GB", metric.getUnits());
        assertEquals("143", metric.getTn());
        assertEquals("180", metric.getTmax());
        assertEquals("0", metric.getDmax());
        assertEquals("both", metric.getSlope());
        assertEquals("gmond", metric.getSource());

        //extra data of the metric
        HashMap<String, String> extraData = metric.getExtraData();
        assertEquals("disk", extraData.get(GangliaMetKeys.GROUP));
        assertEquals("Total free disk space", extraData.get(GangliaMetKeys.DESC));
        assertEquals("Disk Space Available", extraData.get(GangliaMetKeys.TITLE));
    }
View Full Code Here

Examples of org.jboss.as.console.client.shared.runtime.Metric

                Console.error(Console.MESSAGES.failed("JVM Status ")+serverName, caught.getMessage());
            }

            @Override
            public void onSuccess(CompositeVMMetric result) {
                getView().setHeap(new Metric(
                        result.getHeap().getMax(),
                        result.getHeap().getUsed(),
                        result.getHeap().getCommitted(),
                        result.getHeap().getInit()
                ));

                getView().setNonHeap(new Metric(
                        result.getNonHeap().getMax(),
                        result.getNonHeap().getUsed(),
                        result.getNonHeap().getCommitted(),
                        result.getNonHeap().getInit()

                ));
                getView().setOSMetric(result.getOs());
                getView().setRuntimeMetric(result.getRuntime());
                getView().setThreads(
                        new Metric(
                                result.getThreads().getCount(),
                                result.getThreads().getDaemonCount()
                        )
                );
            }
View Full Code Here

Examples of org.jboss.as.console.client.shared.runtime.Metric

            }

            @Override
            public void onSuccess(CompositeVMMetric result) {

                getView().setHeap(new Metric(
                        result.getHeap().getMax(),
                        result.getHeap().getUsed(),
                        result.getHeap().getCommitted(),
                        result.getHeap().getInit()

                ));

                getView().setNonHeap(new Metric(
                        result.getNonHeap().getMax(),
                        result.getNonHeap().getUsed(),
                        result.getNonHeap().getCommitted(),
                        result.getNonHeap().getInit()
                ));

                getView().setThreads(new Metric(
                        result.getThreads().getCount(),
                        result.getThreads().getDaemonCount()
                ));

                getView().setOSMetric(result.getOs());
View Full Code Here

Examples of org.jboss.as.console.client.shared.runtime.Metric

                    long messageCount = result.get("message-count").asLong();
                    long messagesAdded = result.get("messages-added").asLong();
                    long delivering = result.get("delivering-count").asLong();

                    Metric queueInflight = new Metric(
                            messageCount,
                            delivering
                    );

                    Metric queueProcessed = new Metric(
                            messagesAdded,
                            result.get("scheduled-count").asLong()
                    );

                    Metric queueConsumer = new Metric(
                            result.get("consumer-count").asLong()
                    );

                    getView().setQueueInflight(queueInflight);
                    getView().setQueueProcessed(queueProcessed);
View Full Code Here

Examples of org.jboss.as.console.client.shared.runtime.Metric

                    ModelNode result = response.get(RESULT).asObject();

                    long messageCount = result.get("message-count").asLong();
                    long delivering = result.get("delivering-count").asLong();

                    Metric topicInflight = new Metric(
                            messageCount,
                            delivering
                    );

                    Metric topicProcessed = new Metric(
                            result.get("messages-added").asLong(),
                            result.get("durable-message-count").asLong(),
                            result.get("non-durable-message-count").asLong()

                    );

                    Metric topicSubscriptions = new Metric(
                            result.get("subscription-count").asLong(),
                            result.get("durable-subscription-count").asLong(),
                            result.get("non-durable-subscription-count").asLong()
                    );
View Full Code Here

Examples of org.jboss.as.console.client.shared.runtime.Metric

                Console.error(Console.MESSAGES.failed("JVM Status "), caught.getMessage());
            }

            @Override
            public void onSuccess(CompositeVMMetric result) {
                getView().setHeap(new Metric(
                        result.getHeap().getMax(),
                        result.getHeap().getUsed(),
                        result.getHeap().getCommitted(),
                        result.getHeap().getInit()
                ));

                getView().setNonHeap(new Metric(
                        result.getNonHeap().getMax(),
                        result.getNonHeap().getUsed(),
                        result.getNonHeap().getCommitted(),
                        result.getNonHeap().getInit()

                ));
                getView().setOSMetric(result.getOs());
                getView().setRuntimeMetric(result.getRuntime());
                getView().setThreads(
                        new Metric(
                                result.getThreads().getCount(),
                                result.getThreads().getDaemonCount()
                        )
                );
            }
View Full Code Here

Examples of org.jboss.as.console.client.shared.runtime.Metric

                }
                else
                {
                    ModelNode result = response.get(RESULT).asObject();

                    Metric metric = new Metric(
                            result.get("requestCount").asLong(),
                            result.get("errorCount").asLong(),
                            result.get("processingTime").asLong(),
                            result.get("maxTime").asLong()
                    );
View Full Code Here

Examples of org.jboss.as.console.client.shared.runtime.Metric

                    long avail = result.get("AvailableCount").asLong();
                    long active = result.get("ActiveCount").asLong();
                    long max = result.get("MaxUsedCount").asLong();

                    Metric poolMetric = new Metric(
                            avail,active,max
                    );

                    getView().setDSPoolMetric(poolMetric, isXA);
                }
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.