Package org.apache.accumulo.trace.instrument

Examples of org.apache.accumulo.trace.instrument.Span


    }
  }
 
  @Override
  public void undo(long tid, T environment) throws Exception {
    Span span = Trace.trace(tinfo, repo.getDescription());
    try {
      repo.undo(tid, environment);
    } finally {
      span.stop();
    }
  }
View Full Code Here


            return method.invoke(instance, args);
          } catch (InvocationTargetException ex) {
            throw ex.getCause();
          }
        }
        Span span = Trace.trace((TInfo) args[0], method.getName());
        try {
          return method.invoke(instance, args);
        } catch (InvocationTargetException ex) {
          throw ex.getCause();
        } finally {
          span.stop();
        }
      }
    };
    return (T) Proxy.newProxyInstance(instance.getClass().getClassLoader(), instance.getClass().getInterfaces(), handler);
  }
View Full Code Here

        }
        Class<?> klass = method.getParameterTypes()[0];
        if (TInfo.class.isAssignableFrom(klass)) {
          args[0] = Tracer.traceInfo();
        }
        Span span = Trace.start("client:" + method.getName());
        try {
          return method.invoke(instance, args);
        } catch (InvocationTargetException ex) {
          throw ex.getCause();
        } finally {
          span.stop();
        }
      }
    };
    return (T) Proxy.newProxyInstance(instance.getClass().getClassLoader(), instance.getClass().getInterfaces(), handler);
  }
View Full Code Here

    }
  }
 
  @Override
  public boolean isDirectory(Path f) throws IOException {
    Span span = Trace.start("isDirectory");
    if (Trace.isTracing())
      span.data("path", f.toString());
    try {
      return impl.getFileStatus(f).isDir();
    } finally {
      span.stop();
    }
  }
View Full Code Here

    }
  }
 
  @Override
  public boolean isFile(Path f) throws IOException {
    Span span = Trace.start("isFile");
    if (Trace.isTracing())
      span.data("path", f.toString());
    try {
      return impl.isFile(f);
    } finally {
      span.stop();
    }
  }
View Full Code Here

  }
 
  @SuppressWarnings("deprecation")
  @Override
  public long getLength(Path f) throws IOException {
    Span span = Trace.start("getLength");
    if (Trace.isTracing())
      span.data("path", f.toString());
    try {
      return impl.getLength(f);
    } finally {
      span.stop();
    }
  }
View Full Code Here

    }
  }
 
  @Override
  public ContentSummary getContentSummary(Path f) throws IOException {
    Span span = Trace.start("getContentSummary");
    if (Trace.isTracing())
      span.data("path", f.toString());
    try {
      return impl.getContentSummary(f);
    } finally {
      span.stop();
    }
  }
View Full Code Here

   
    Trace.on("nop").stop();
    assertTrue(tracer.traces.size() == 1);
    assertFalse(Trace.isTracing());
   
    Span start = Trace.on("testing");
    assertEquals(Trace.currentTrace(), start);
    assertTrue(Trace.isTracing());
   
    Trace.start("shortest trace ever");
    Trace.currentTrace().stop();
    long traceId = Trace.currentTrace().traceId();
    assertNotNull(tracer.traces.get(traceId));
    assertTrue(tracer.traces.get(traceId).size() == 1);
    assertEquals("shortest trace ever", tracer.traces.get(traceId).get(0).description);
   
    Span pause = Trace.start("pause");
    Thread.sleep(100);
    pause.stop();
    assertTrue(tracer.traces.get(traceId).size() == 2);
    assertTrue(tracer.traces.get(traceId).get(1).millis() >= 100);
   
    Thread t = new Thread(Trace.wrap(new Runnable() {
      @Override
View Full Code Here

    TTransport clientTransport = new TSocket(new Socket("localhost", socket.getLocalPort()));
    TestService.Iface client = new TestService.Client(new TBinaryProtocol(clientTransport), new TBinaryProtocol(clientTransport));
    client = TraceWrap.client(client);
    assertFalse(client.checkTrace(null, "test"));
   
    Span start = Trace.on("start");
    assertTrue(client.checkTrace(null, "my test"));
    start.stop();
   
    assertNotNull(tracer.traces.get(start.traceId()));
    String traces[] = {"my test", "checkTrace", "client:checkTrace", "start"};
    assertTrue(tracer.traces.get(start.traceId()).size() == traces.length);
    for (int i = 0; i < traces.length; i++)
      assertEquals(traces[i], tracer.traces.get(start.traceId()).get(i).description);
   
    tserver.stop();
    t.join(100);
  }
View Full Code Here

    }
  }
 
  @Override
  public FileStatus[] listStatus(Path f, PathFilter filter) throws IOException {
    Span span = Trace.start("listStatus");
    if (Trace.isTracing())
      span.data("path", f.toString());
    try {
      return impl.listStatus(f, filter);
    } finally {
      span.stop();
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.accumulo.trace.instrument.Span

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.