Package com.yammer.metrics.reporting

Examples of com.yammer.metrics.reporting.CsvReporter


     * @param period       The reporting interval.
     * @param timeunit     The TimeUnit for the reporting interval.
     */
    public YammerMetricsAssembler( File outDirectory, long period, TimeUnit timeunit )
    {
        reporter = new CsvReporter( Metrics.defaultRegistry(), outDirectory );
        reporter.start( period, timeunit );
    }
View Full Code Here


                return false;
            }
            // static enable() methods omit the option of specifying a
            // predicate.  Calling constructor and starting manually
            // instead
            final CsvReporter reporter = new CsvReporter(Metrics.defaultRegistry(), getMetricPredicate(), foutDir);
            reporter.start(getPeriod(), getRealTimeunit());
        }
        catch (Exception e)
        {
            log.error("Failure while Enabling CsvReporter", e);
            return false;
View Full Code Here

    // JmxReporter jmxReporter = new JmxReporter(Metrics.defaultRegistry());

    File csvOut = new File("csvout");
    csvOut.mkdirs();
    CsvReporter csvReporter = new CsvReporter(csvOut, Metrics.defaultRegistry());
    // GangliaReporter csvReporter = new
    // GangliaReporter(Metrics.defaultRegistry(),"localhost",8649,"zoie-perf");

    int updateInterval = conf.getInt("perf.update.intervalSec", 2);
    csvReporter.start(updateInterval, TimeUnit.SECONDS);

    long maxEventsPerMin = conf.getLong("perf.maxEventsPerMin");

    dataProvider.setMaxEventsPerMinute(maxEventsPerMin);

    int numThreads = conf.getInt("perf.query.threads", 10);

    SearchThread[] searchThreads = null;

    if (doSearchTest) {
      searchThreads = new SearchThread[numThreads];
      for (int i = 0; i < numThreads; ++i) {
        searchThreads[i] = new SearchThread();
      }
    } else {
      searchThreads = new SearchThread[0];
    }

    dataProvider.start();

    for (int i = 0; i < searchThreads.length; ++i) {
      searchThreads[i].start();
    }

    ZoiePerfVersion perfVersion = ZoiePerfVersion.fromString(testHandler.consumer.getVersion());
    long eventCount;
    while ((eventCount = perfVersion.countVersion + 1) < maxSize) {
      Thread.sleep(500);
      perfVersion = ZoiePerfVersion.fromString(testHandler.consumer.getVersion());
    }

    dataProvider.stop();
    testHandler.consumer.stop();

    long end = System.currentTimeMillis();

    for (int i = 0; i < searchThreads.length; ++i) {
      searchThreads[i].terminate();
    }

    for (int i = 0; i < searchThreads.length; ++i) {
      searchThreads[i].join();
    }

    // consoleReporter.shutdown();
    // jmxReporter.shutdown();

    csvReporter.shutdown();

    System.out.println("Test duration: " + (end - start) + " ms");

    System.out.println("Amount of event consumed: " + eventCount);
  }
View Full Code Here

TOP

Related Classes of com.yammer.metrics.reporting.CsvReporter

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.