call.traceScope.reattach(); traceScope = call.traceScope; traceScope.getSpan().addTimelineAnnotation("called");
call.traceScope.reattach(); traceScope = call.traceScope; traceScope.getSpan().addTimelineAnnotation("called");
scope.reattach(); scope.close(); endOfBlockPacket.setTraceScope(null);
scope = one.getTraceScope(); if (scope != null) { scope.reattach(); one.setTraceScope(null);
/** * Test calling reattach() two times on a scope object. */ @Test public void TestDoubleReattachIsCaught() throws Exception { Tracer tracer = new Tracer.Builder(). name("TestDoubleReattach"). tracerPool(new TracerPool("TestDoubleReattachIsCaught")). conf(HTraceConfiguration. fromKeyValuePairs("sampler.classes", "AlwaysSampler")).build(); boolean gotException = false; TraceScope myScope = tracer.newScope("myScope"); myScope.detach(); myScope.reattach(); try { myScope.reattach(); } catch (RuntimeException e) { assertThat(e.getMessage(), containsString("it is not detached.")); gotException = true; } assertTrue("Expected to get exception because of double TraceScope " + "reattach.", gotException); tracer.close(); }
private void verifyNullScope(TraceScope scope) { Assert.assertTrue(null == scope.getSpan()); Assert.assertFalse(scope.detached); scope.detach(); Assert.assertTrue(scope.detached); scope.reattach(); Assert.assertFalse(scope.detached); scope.close(); }
workerScope.reattach(); TraceScope nested = tracer.newScope("nested"); nested.close();