Package com.yammer.metrics.core

Examples of com.yammer.metrics.core.Meter


        Histogram readAccess = Metrics.newHistogram(new MetricName(ORG_APACHE_BLUR, HDFS, "Read Latency in \u00B5s",
            scope));
        Histogram writeAccess = Metrics.newHistogram(new MetricName(ORG_APACHE_BLUR, HDFS, "Write Latency in \u00B5s",
            scope));
        Meter readThroughput = Metrics.newMeter(new MetricName(ORG_APACHE_BLUR, HDFS, "Read Throughput", scope),
            "Read Bytes", TimeUnit.SECONDS);
        Meter writeThroughput = Metrics.newMeter(new MetricName(ORG_APACHE_BLUR, HDFS, "Write Throughput", scope),
            "Write Bytes", TimeUnit.SECONDS);
        metricsGroup = new MetricsGroup(readAccess, writeAccess, readThroughput, writeThroughput);
        metricsGroupMap.put(uri, metricsGroup);
      }
      this.metricsGroup = metricsGroup;
View Full Code Here


    MetricName readThroughputName = new MetricName(ORG_APACHE_BLUR, HDFS, "Read Throughput", scope);
    MetricName writeThroughputName = new MetricName(ORG_APACHE_BLUR, HDFS, "Write Throughput", scope);

    Histogram readAccess = Metrics.newHistogram(readAccessName);
    Histogram writeAccess = Metrics.newHistogram(writeAcccessName);
    Meter readThroughput = Metrics.newMeter(readThroughputName, "Read Bytes", TimeUnit.SECONDS);
    Meter writeThroughput = Metrics.newMeter(writeThroughputName, "Write Bytes", TimeUnit.SECONDS);
    return new MetricsGroup(readAccess, writeAccess, readThroughput, writeThroughput);
  }
View Full Code Here

                String counterName = metricName.getType() + ": " + metricName.getName();
                if (metric instanceof Counter) {
                    Counter counter = (Counter) metric;
                    context.getCounter(COUNTER_GROUP, counterName).increment(counter.count());
                } else if (metric instanceof Meter) {
                    Meter meter = (Meter) metric;
                    context.getCounter(COUNTER_GROUP, counterName).increment(meter.count());
                } else if (metric instanceof Timer) {
                    Timer timer = (Timer) metric;
                    context.getCounter(COUNTER_GROUP, counterName).increment((long) timer.sum());
                }
            }
View Full Code Here

   */
  public static void initMetrics() {
    GiraphMetricsRegistry metrics = GiraphMetrics.get().perJobRequired();

    final Counter edgesFiltered = getTotalEdgesFilteredCounter();
    final Meter edgesLoaded = getTotalEdgesLoadedMeter();

    metrics.getGauge(MetricNames.EDGES_FILTERED_PCT, new PercentGauge() {
      @Override protected double getNumerator() {
        return edgesFiltered.count();
      }

      @Override protected double getDenominator() {
        return edgesLoaded.count();
      }
    });

    final Counter verticesFiltered = getTotalVerticesFilteredCounter();
    final Meter verticesLoaded = getTotalVerticesLoadedMeter();

    metrics.getGauge(MetricNames.VERTICES_FILTERED_PCT, new PercentGauge() {
      @Override protected double getNumerator() {
        return verticesFiltered.count();
      }

      @Override protected double getDenominator() {
        return verticesLoaded.count();
      }
    });
  }
View Full Code Here

    public void testCreateMetric() {
        Metric metric = metricCatcher.createMetric(jsonMetric);

        assertEquals(Meter.class, metric.getClass());

        Meter meterMetric = ((Meter) metric);
        // All metrics are in minutes :-( plz2fix
        assertEquals(TimeUnit.MINUTES, meterMetric.rateUnit());
    }
View Full Code Here

        assertEquals(metric, actual);
    }

    @Test
    public void testUpdateMetric() {
        Meter metric = (Meter) metricCatcher.createMetric(jsonMetric);
        metricCatcher.updateMetric(metric, 1);
        assertEquals(1, metric.count());
    }
View Full Code Here

        assertEquals((long) 4, counter.count());
    }

    @Test
    public void testUpdateMetric_MultipleUpdates() {
        Meter metric = (Meter) metricCatcher.createMetric(jsonMetric);

        int count = 7;
        for (int x = 0; x < 7; x++) {
            metricCatcher.updateMetric(metric, 1);
        }

        assertEquals(count, metric.count());
    }
View Full Code Here

        assertEquals(count, metric.count());
    }

    @Test
    public void testUpdateMetric_Meter_MarkWithZeroHasNoEffect() {
        Meter metric = (Meter) metricCatcher.createMetric(jsonMetric);
        metricCatcher.updateMetric(metric, 0);
        assertEquals(0, metric.count());
    }
View Full Code Here

    public void basicEcho() throws Exception {

        final int messageSize = 64 * 1024;
        final int transferLimit = messageSize * 16;

        final Meter rate1 = Metrics.newMeter(
                NioUdtMessageRendezvousChannelTest.class, "send rate", "bytes",
                TimeUnit.SECONDS);

        final Meter rate2 = Metrics.newMeter(
                NioUdtMessageRendezvousChannelTest.class, "send rate", "bytes",
                TimeUnit.SECONDS);

        final InetSocketAddress addr1 = UnitHelp.localSocketAddress();
        final InetSocketAddress addr2 = UnitHelp.localSocketAddress();
View Full Code Here

    public void basicEcho() throws Exception {

        final int messageSize = 64 * 1024;
        final int transferLimit = messageSize * 16;

        final Meter rate1 = Metrics.newMeter(
                NioUdtMessageRendezvousChannelTest.class, "send rate", "bytes", TimeUnit.SECONDS);

        final Meter rate2 = Metrics.newMeter(
                NioUdtMessageRendezvousChannelTest.class, "send rate", "bytes", TimeUnit.SECONDS);

        final InetSocketAddress addr1 = UnitHelp.localSocketAddress();
        final InetSocketAddress addr2 = UnitHelp.localSocketAddress();

View Full Code Here

TOP

Related Classes of com.yammer.metrics.core.Meter

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.