Package com.yammer.metrics.core

Examples of com.yammer.metrics.core.MeterMetric


    boolean doSearchTest = conf.getBoolean("perf.test.search", true);

    final TimerMetric searchTimer = Metrics.newTimer(ZoiePerf.class, "searchTimer",
      TimeUnit.NANOSECONDS, TimeUnit.SECONDS);
    final MeterMetric errorMeter = Metrics.newMeter(ZoiePerf.class, "errorMeter", "error",
      TimeUnit.SECONDS);

    monitoredMetrics.put("searchTimer", searchTimer);
    monitoredMetrics.put("errorMeter", errorMeter);

    final long waitTime = conf.getLong("perf.query.threadWait", 200);

    final class SearchThread extends Thread {

      private volatile boolean stop = false;

      public void terminate() {
        stop = true;
        synchronized (this) {
          this.notifyAll();
        }
      }

      @SuppressWarnings({ "unchecked", "rawtypes" })
      @Override
      public void run() {
        while (!stop) {
          try {
            searchTimer.time(new Callable() {
              @Override
              public Object call() throws Exception {
                return testHandler.queryHandler.handleQuery();
              }
            });

          } catch (Exception e) {
            errorMeter.mark();
          }

          synchronized (this) {
            try {
              this.wait(waitTime);
View Full Code Here

TOP

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

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.