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

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

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

origin: Nike-Inc/wingtips

/**
 * @return A *copy* of the current thread's tracing information - retrieved by calling {@link
 * Tracer#getCurrentTracingStateCopy()}. Since this creates copies of the span stack and MDC info it can be
 * have a noticeable performance impact if used too many times (i.e. tens or hundreds of times per request for high
 * throughput services). NOTE: This is usually not needed unless you're doing asynchronous processing and need to
 * pass tracing state across thread boundaries.
 */
public static TracingState getCurrentThreadTracingState() {
  return Tracer.getInstance().getCurrentTracingStateCopy();
}
origin: Nike-Inc/wingtips

@Test
public void getCurrentTracingStateCopy_works_as_expected() {
  // given
  Tracer tracer = Tracer.getInstance();
  tracer.startRequestWithRootSpan("request-" + UUID.randomUUID().toString());
  Deque<Span> currentSpanStack = tracer.getCurrentSpanStackCopy();
  Map<String, String> currentMdcInfo = MDC.getCopyOfContextMap();
  assertThat(currentSpanStack.size()).isGreaterThanOrEqualTo(1);
  assertThat(currentMdcInfo).isNotEmpty();
  // when
  TracingState currentTracingState = tracer.getCurrentTracingStateCopy();
  // then
  assertThat(currentTracingState.spanStack).isEqualTo(currentSpanStack);
  assertThat(currentTracingState.mdcInfo).isEqualTo(currentMdcInfo);
}
com.nike.wingtipsTracergetCurrentTracingStateCopy

Popular methods of Tracer

  • getInstance
  • 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
  • registerWithThread,
  • startSubSpan,
  • completeSubSpan,
  • startRequestWithChildSpan,
  • setSpanLoggingRepresentation,
  • configureMDC,
  • containsSameSpansInSameOrder,
  • getCurrentManagedStatusForSpan,
  • getCurrentSpanStackSize

Popular in Java

  • Making http requests using okhttp
  • findViewById (Activity)
  • getResourceAsStream (ClassLoader)
  • setContentView (Activity)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • From CI to AI: The AI layer in your organization
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