Package org.apache.accumulo.cloudtrace.instrument

Examples of org.apache.accumulo.cloudtrace.instrument.CountSampler


public class CountSamplerTest {
 
  @Test
  public void testNext() {
    CountSampler half = new CountSampler(2);
    CountSampler hundred = new CountSampler(100);
    int halfCount = 0;
    int hundredCount = 0;
    for (int i = 0; i < 200; i++) {
      if (half.next())
        halfCount++;
      if (hundred.next())
        hundredCount++;
    }
    Assert.assertEquals(2, hundredCount);
    Assert.assertEquals(100, halfCount);
  }
View Full Code Here


        log.warn(e, e);
        return;
      }
    }
   
    Sampler sampler = new CountSampler(100);
   
    while (true) {
      if (sampler.next())
        Trace.on("gc");
     
      Span gcSpan = Trace.start("loop");
      tStart = System.currentTimeMillis();
      try {
View Full Code Here

    if (!conn.tableOperations().exists(table)) {
      throw new TableNotFoundException(null, table, "Consult the README and create the table before starting ingest.");
    }

    BatchWriter bw = conn.createBatchWriter(table, maxMemory, maxLatency, maxWriteThreads);
    bw = Trace.wrapAll(bw, new CountSampler(1024));
   
    Random r = new Random();
   
    byte[] ingestInstanceId = UUID.randomUUID().toString().getBytes();
   
View Full Code Here

public class CountSamplerTest {
 
  @Test
  public void testNext() {
    CountSampler half = new CountSampler(2);
    CountSampler hundred = new CountSampler(100);
    int halfCount = 0;
    int hundredCount = 0;
    for (int i = 0; i < 200; i++) {
      if (half.next())
        halfCount++;
      if (hundred.next())
        hundredCount++;
    }
    Assert.assertEquals(2, hundredCount);
    Assert.assertEquals(100, halfCount);
  }
View Full Code Here

      try {
        conn.tableOperations().create(table);
      } catch (TableExistsException tee) {}

    BatchWriter bw = conn.createBatchWriter(table, maxMemory, maxLatency, maxWriteThreads);
    bw = Trace.wrapAll(bw, new CountSampler(1024));
   
    Random r = new Random();
   
    byte[] ingestInstanceId = UUID.randomUUID().toString().getBytes();
   
View Full Code Here

        log.warn(e, e);
        return;
      }
    }
   
    Sampler sampler = new CountSampler(100);
   
    while (true) {
      if (sampler.next())
        Trace.on("gc");
     
      Span gcSpan = Trace.start("loop");
      tStart = System.currentTimeMillis();
      try {
View Full Code Here

    String localhost = InetAddress.getLocalHost().getHostName();
    String path = ZooUtil.getRoot(instance) + Constants.ZTRACERS;
    Tracer.getInstance().addReceiver(new ZooSpanClient(zooKeepers, path, localhost, "cingest", 1000));
   
    BatchWriter bw = conn.createBatchWriter(table, maxMemory, maxLatency, maxWriteThreads);
    bw = Trace.wrapAll(bw, new CountSampler(1024));
   
    Random r = new Random();
   
    byte[] ingestInstanceId = UUID.randomUUID().toString().getBytes();
   
View Full Code Here

        log.warn(e, e);
        return;
      }
    }
   
    Sampler sampler = new CountSampler(100);
   
    while (true) {
      if (sampler.next())
        Trace.on("gc");
     
      Span gcSpan = Trace.start("loop");
      tStart = System.currentTimeMillis();
      try {
View Full Code Here

      try {
        conn.tableOperations().create(table);
      } catch (TableExistsException tee) {}

    BatchWriter bw = conn.createBatchWriter(table, maxMemory, maxLatency, maxWriteThreads);
    bw = Trace.wrapAll(bw, new CountSampler(1024));
   
    Random r = new Random();
   
    byte[] ingestInstanceId = UUID.randomUUID().toString().getBytes();
   
View Full Code Here

        log.warn(e, e);
        return;
      }
    }
   
    Sampler sampler = new CountSampler(100);
   
    while (true) {
      if (sampler.next())
        Trace.on("gc");
     
      Span gcSpan = Trace.start("loop");
      tStart = System.currentTimeMillis();
      try {
View Full Code Here

TOP

Related Classes of org.apache.accumulo.cloudtrace.instrument.CountSampler

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.