Package com.cloudera.util

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


    for (int i = 0; i < times; i++) {
      @SuppressWarnings("unused")
      String temp = base + i;
    }
    b.mark("after " + times);
    b.done();
  }

  @Test
  public void testStringBufferAppend2() {
    StringBuffer buf = new StringBuffer(base);
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 testStringBuilderAppend2() {
    StringBuilder buf = new StringBuilder(base);
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() {
    String format = "%s%d";
View Full Code Here

    Assert.assertEquals(2916, histo.get("ConnectException"));
    Assert.assertEquals(230663, histo.get("Lost tracker"));
    Assert.assertEquals(166834, histo.get("mapred.TaskTracker: Resending"));
   
   
    b.done();
  }
}
View Full Code Here

    b.mark("thrift sink to thrift source done");

    tes.close();
    snk.close();
    drain.interrupt();
    b.done();
  }

  /**
   * This is slighlty different by using another thread to kick off the sink. It
   * shouldn't really matter much.
View Full Code Here

    Thread.sleep(1000);
    tes.close();
    snk.close();
    t.interrupt();
    drain.interrupt();
    b.done();
  }

  /**
   * Here we are using the ThriftRawEventSink instead of the ThriftEventSink
   *
 
View Full Code Here

    b.mark("thrift sink to thrift source done");

    tes.close();
    snk.close();
    drain.interrupt();
    b.done();
  }

}
View Full Code Here

      b.mark("reservoir", sz);

      res.close();
      b.mark("count", cnt.getCount());
    }
    b.done();
  }

  @Test
  public void testIntervalSampler() throws IOException, InterruptedException {
    Benchmark b = new Benchmark("Interval sampler + nullsink");
View Full Code Here

      b.mark("interval", sz);

      res.close();
      b.mark("count", cnt.getCount());
    }
    b.done();
  }

  @Test
  public void testProbabilitySampler() throws IOException, InterruptedException {
    Benchmark b = new Benchmark("Reservoir sampler + nullsink");
View Full Code Here

      b.mark("probability", prob);

      res.close();
      b.mark("count", cnt.getCount());
    }
    b.done();
  }

}
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.