congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
Tracer.getInstance
Code IndexAdd Tabnine to your IDE (free)

How to use
getInstance
method
in
com.nike.wingtips.Tracer

Best Java code snippets using com.nike.wingtips.Tracer.getInstance (Showing top 20 results out of 315)

origin: Nike-Inc/wingtips

private void clearTracerSpanLifecycleListeners() {
  List<SpanLifecycleListener> listeners = new ArrayList<>(Tracer.getInstance().getSpanLifecycleListeners());
  for (SpanLifecycleListener listener : listeners) {
    Tracer.getInstance().removeSpanLifecycleListener(listener);
  }
}
origin: Nike-Inc/wingtips

  protected CloseableHttpResponse propagateHeadersAndExecute(
    HttpRoute route,
    HttpRequestWrapper request,
    HttpClientContext clientContext,
    HttpExecutionAware execAware
  ) throws IOException, HttpException {
    propagateTracingHeaders(request, Tracer.getInstance().getCurrentSpan());
    return protocolExec.execute(route, request, clientContext, execAware);
  }
};
origin: Nike-Inc/wingtips

private void clearTracerSpanLifecycleListeners() {
  List<SpanLifecycleListener> listeners = new ArrayList<>(Tracer.getInstance().getSpanLifecycleListeners());
  for (SpanLifecycleListener listener : listeners) {
    Tracer.getInstance().removeSpanLifecycleListener(listener);
  }
}
origin: Nike-Inc/wingtips

private void clearTracerSpanLifecycleListeners() {
  List<SpanLifecycleListener> listeners = new ArrayList<>(Tracer.getInstance().getSpanLifecycleListeners());
  for (SpanLifecycleListener listener : listeners) {
    Tracer.getInstance().removeSpanLifecycleListener(listener);
  }
}
origin: Nike-Inc/wingtips

private void removeSpanRecorderLifecycleListener() {
  List<SpanLifecycleListener> listeners = new ArrayList<>(Tracer.getInstance().getSpanLifecycleListeners());
  for (SpanLifecycleListener listener : listeners) {
    if (listener instanceof SpanRecorder) {
      Tracer.getInstance().removeSpanLifecycleListener(listener);
    }
  }
}
origin: Nike-Inc/wingtips

private void clearTracerSpanLifecycleListeners() {
  List<SpanLifecycleListener> listeners = new ArrayList<>(Tracer.getInstance().getSpanLifecycleListeners());
  for (SpanLifecycleListener listener : listeners) {
    Tracer.getInstance().removeSpanLifecycleListener(listener);
  }
}
origin: Nike-Inc/wingtips

private void removeSpanRecorderLifecycleListener() {
  List<SpanLifecycleListener> listeners = new ArrayList<>(Tracer.getInstance().getSpanLifecycleListeners());
  for (SpanLifecycleListener listener : listeners) {
    if (listener instanceof SpanRecorder) {
      Tracer.getInstance().removeSpanLifecycleListener(listener);
    }
  }
}
origin: Nike-Inc/wingtips

private void clearTracerSpanLifecycleListeners() {
  List<SpanLifecycleListener> listeners = new ArrayList<>(Tracer.getInstance().getSpanLifecycleListeners());
  for (SpanLifecycleListener listener : listeners) {
    Tracer.getInstance().removeSpanLifecycleListener(listener);
  }
}
origin: Nike-Inc/wingtips

  @Override
  public Object answer(InvocationOnMock invocation) throws Throwable {
    currentSpanStackWhenCallableWasCalled.add(Tracer.getInstance().getCurrentSpanStackCopy());
    currentMdcInfoWhenCallableWasCalled.add(MDC.getCopyOfContextMap());
    if (throwExceptionDuringCall)
      throw new RuntimeException("kaboom");
    return null;
  }
}).when(callableMock).call();
origin: Nike-Inc/wingtips

private Span findCompletedSpanByCriteria(Predicate<Span> criteria) {
  Tracer.getInstance().setSpanLoggingRepresentation(Tracer.SpanLoggingRepresentation.KEY_VALUE);
  List<Span> matchingSpans = spanRecorder.completedSpans.stream().filter(criteria).collect(Collectors.toList());
  assertThat(matchingSpans)
    .withFailMessage(
      "Expected to find exactly 1 span matching the specified criteria - instead found: "
      + matchingSpans.size()
    )
    .hasSize(1);
  return matchingSpans.get(0);
}
origin: Nike-Inc/wingtips

@Test(expected = IllegalArgumentException.class)
public void setRootSpanSamplingStrategy_should_explode_if_passed_null() {
  // expect
  Tracer.getInstance().setRootSpanSamplingStrategy(null);
}
origin: Nike-Inc/wingtips

private Pair<Deque<Span>, Map<String, String>> setupCurrentThreadWithTracingInfo() {
  resetTracing();
  Tracer.getInstance().startRequestWithRootSpan("request-" + UUID.randomUUID().toString());
  return Pair.of(Tracer.getInstance().getCurrentSpanStackCopy(), MDC.getCopyOfContextMap());
}

origin: Nike-Inc/wingtips

@Test
public void close_completes_the_span_as_expected_overall_request_span() {
  // given
  Span overallSpan = Tracer.getInstance().startRequestWithRootSpan("root");
  assertThat(Tracer.getInstance().getCurrentSpan()).isSameAs(overallSpan);
  assertThat(overallSpan.isCompleted()).isFalse();
  // when
  overallSpan.close();
  // then
  assertThat(overallSpan.isCompleted()).isTrue();
  assertThat(Tracer.getInstance().getCurrentSpan()).isNull();
}
origin: Nike-Inc/wingtips

private Pair<Deque<Span>, Map<String, String>> generateTracingInfo() {
  resetTracing();
  Tracer.getInstance().startRequestWithRootSpan("someSpan");
  Pair<Deque<Span>, Map<String, String>> result = Pair.of(
    Tracer.getInstance().getCurrentSpanStackCopy(), new HashMap<>(MDC.getCopyOfContextMap())
  );
  resetTracing();
  return result;
}
origin: Nike-Inc/wingtips

@Test(expected = IllegalArgumentException.class)
public void startRequestWithChildSpan_throws_IllegalArgumentException_if_passed_null_parent() {
  // expect
  Tracer.getInstance().startRequestWithChildSpan(null, "somechildspan");
  fail("Expected IllegalArgumentException but no exception was thrown");
}
origin: Nike-Inc/wingtips

private void resetTracing() {
  MDC.clear();
  Tracer.getInstance().unregisterFromThread();
  removeSpanRecorderLifecycleListener();
}
origin: Nike-Inc/wingtips

@Before
public void beforeMethod() {
  removeSpanRecorderLifecycleListener();
  spanRecorder = new SpanRecorder();
  Tracer.getInstance().addSpanLifecycleListener(spanRecorder);
}
origin: Nike-Inc/wingtips

@Before
public void beforeMethod() {
  clearTracerSpanLifecycleListeners();
  spanRecorder = new SpanRecorder();
  Tracer.getInstance().addSpanLifecycleListener(spanRecorder);
}
origin: Nike-Inc/wingtips

@Before
public void beforeMethod() {
  clearTracerSpanLifecycleListeners();
  spanRecorder = new SpanRecorder();
  Tracer.getInstance().addSpanLifecycleListener(spanRecorder);
}
origin: Nike-Inc/wingtips

@Before
public void beforeMethod() {
  resetTracing();
  spanRecorder = new SpanRecorder();
  Tracer.getInstance().addSpanLifecycleListener(spanRecorder);
}
com.nike.wingtipsTracergetInstance

Popular methods of Tracer

  • getCurrentSpan
  • addSpanLifecycleListener
    Adds the given listener to the #spanLifecycleListeners list using java.util.List#add(Object). This m
  • getSpanLifecycleListeners
  • removeSpanLifecycleListener
    Returns the value of calling java.util.List#remove(Object) on #spanLifecycleListeners.
  • getCurrentSpanStackCopy
  • startRequestWithRootSpan
  • unregisterFromThread
  • completeRequestSpan
  • startSpanInCurrentContext
  • registerWithThread
  • startSubSpan
  • completeSubSpan
  • startSubSpan,
  • completeSubSpan,
  • startRequestWithChildSpan,
  • setSpanLoggingRepresentation,
  • configureMDC,
  • containsSameSpansInSameOrder,
  • getCurrentManagedStatusForSpan,
  • getCurrentSpanStackSize,
  • getCurrentTracingStateCopy

Popular in Java

  • Creating JSON documents from java classes using gson
  • getSharedPreferences (Context)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getContentResolver (Context)
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • ImageIO (javax.imageio)
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now