Package com.cloudera.util

Examples of com.cloudera.util.Benchmark.mark()


    b.mark("begin");
    for (int i = 0; i < times; i++) {
      buf.append(i);
    }
    b.mark("after " + times);
    b.done();
  }

  @Test
  public void testStringBuilderAppend2() {
View Full Code Here


public class PerfGrepReportSinks implements ExamplePerfData {

  @Test
  public void testHadoopGrep() throws IOException, InterruptedException {
    Benchmark b = new Benchmark("hadoop_greps");
    b.mark("begin");

    MultiGrepReporterBuilder bld = new MultiGrepReporterBuilder(HADOOP_GREP);

    MultiGrepReporterSink<String> snk = bld.load().iterator().next();
    snk.open();
View Full Code Here

  @Test
  public void testStringBuilderAppend2() {
    StringBuilder buf = new StringBuilder(base);
    Benchmark b = new Benchmark("StringBuffer Append");

    b.mark("begin");
    for (int i = 0; i < times; i++) {
      buf.append(i);
    }
    b.mark("after " + times);
    b.done();
View Full Code Here

    MultiGrepReporterBuilder bld = new MultiGrepReporterBuilder(HADOOP_GREP);

    MultiGrepReporterSink<String> snk = bld.load().iterator().next();
    snk.open();
    b.mark("filters_loaded", new File(HADOOP_GREP).getName());

    TextFileSource txt = new TextFileSource(HADOOP_DATA[0]);
    txt.open();
    MemorySinkSource mem = new MemorySinkSource();
    mem.open();
View Full Code Here

    txt.open();
    MemorySinkSource mem = new MemorySinkSource();
    mem.open();
    EventUtil.dumpAll(txt, mem);

    b.mark("disk_loaded");

    EventUtil.dumpAll(mem, snk);
    b.mark(snk.getName() + " done");

    Histogram<String> histo = snk.getHistogram();
View Full Code Here

    b.mark("begin");
    for (int i = 0; i < times; i++) {
      buf.append(i);
    }
    b.mark("after " + times);
    b.done();
  }

  @Test
  public void testStringFormat2() {
View Full Code Here

    EventUtil.dumpAll(txt, mem);

    b.mark("disk_loaded");

    EventUtil.dumpAll(mem, snk);
    b.mark(snk.getName() + " done");

    Histogram<String> histo = snk.getHistogram();
    System.out.println(histo);
   
    // from grep | wc
View Full Code Here

  @Test
  public void testThriftSend() throws IOException, InterruptedException {

    Benchmark b = new Benchmark("nullsink");

    b.mark("begin");

    TextFileSource txt = new TextFileSource(HADOOP_DATA[0]);
    txt.open();
    MemorySinkSource mem = new MemorySinkSource();
    mem.open();
View Full Code Here

    txt.open();
    MemorySinkSource mem = new MemorySinkSource();
    mem.open();
    EventUtil.dumpAll(txt, mem);
    txt.close();
    b.mark("disk_loaded");

    FlumeConfiguration conf = FlumeConfiguration.get();
    final ThriftEventSource tes = new ThriftEventSource(conf.getCollectorPort());
    tes.open();
    // need to drain the sink otherwise its queue will fill up with events!
View Full Code Here

          e.printStackTrace();
        }
      }
    };
    drain.start(); // drain the sink.
    b.mark("receiver_started");

    final ThriftEventSink snk = new ThriftEventSink("0.0.0.0", conf
        .getCollectorPort());
    snk.open();
    b.mark("sink_started");
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.