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

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

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

origin: Nike-Inc/wingtips

/**
 * @return this span's *current* status relative to {@link Tracer} on the current thread at the time this method is
 * called. This status is recalculated every time this method is called and is only relevant/correct until {@link
 * Tracer}'s state is modified (i.e. by starting a subspan, completing a span, using any of the asynchronous helper
 * methods to modify the span stack in any way, etc), so it should only be considered relevant for the moment the
 * call is made.
 *
 * <p>NOTE: Most app-level developers should not need to worry about this at all.
 */
public TracerManagedSpanStatus getCurrentTracerManagedSpanStatus() {
  return Tracer.getInstance().getCurrentManagedStatusForSpan(this);
}

origin: Nike-Inc/wingtips

@Test
public void getCurrentManagedStatusForSpan_works_as_expected_for_managed_noncurrent() {
  // given
  Span nonCurrentRootSpan = Tracer.getInstance().startRequestWithRootSpan("root");
  Span nonCurrentSubspan = Tracer.getInstance().startSubSpan("subspan1", SpanPurpose.LOCAL_ONLY);
  Span currentSubspan = Tracer.getInstance().startSubSpan("subspan2", SpanPurpose.LOCAL_ONLY);
  // expect
  assertThat(Tracer.getInstance().getCurrentManagedStatusForSpan(nonCurrentRootSpan))
    .isEqualTo(TracerManagedSpanStatus.MANAGED_NON_CURRENT_ROOT_SPAN);
  assertThat(Tracer.getInstance().getCurrentManagedStatusForSpan(nonCurrentSubspan))
    .isEqualTo(TracerManagedSpanStatus.MANAGED_NON_CURRENT_SUB_SPAN);
}
origin: Nike-Inc/wingtips

@Test
public void getCurrentManagedStatusForSpan_works_as_expected_for_managed_current() {
  {
    // given
    Span currentRootSpan = Tracer.getInstance().startRequestWithRootSpan("root");
    // when
    TracerManagedSpanStatus tmss = Tracer.getInstance().getCurrentManagedStatusForSpan(currentRootSpan);
    // then
    assertThat(tmss).isEqualTo(TracerManagedSpanStatus.MANAGED_CURRENT_ROOT_SPAN);
  }
  {
    // and given
    Span currentSubspan = Tracer.getInstance().startSubSpan("subspan", SpanPurpose.LOCAL_ONLY);
    // when
    TracerManagedSpanStatus tmss = Tracer.getInstance().getCurrentManagedStatusForSpan(currentSubspan);
    // then
    assertThat(tmss).isEqualTo(TracerManagedSpanStatus.MANAGED_CURRENT_SUB_SPAN);
  }
}
origin: Nike-Inc/wingtips

@Test
public void getCurrentManagedStatusForSpan_works_as_expected_for_unmanaged() {
  // given
  Span manuallyCreatedSpan = Span.newBuilder("manuallyCreatedSpan", SpanPurpose.LOCAL_ONLY).build();
  Span completedSpan = Tracer.getInstance().startRequestWithRootSpan("completedSpan");
  Tracer.getInstance().completeRequestSpan();
  // when
  TracerManagedSpanStatus tmssManual = Tracer.getInstance().getCurrentManagedStatusForSpan(manuallyCreatedSpan);
  TracerManagedSpanStatus tmssCompleted = Tracer.getInstance().getCurrentManagedStatusForSpan(completedSpan);
  // then
  assertThat(tmssManual).isEqualTo(TracerManagedSpanStatus.UNMANAGED_SPAN);
  assertThat(tmssCompleted).isEqualTo(TracerManagedSpanStatus.UNMANAGED_SPAN);
}
origin: Nike-Inc/wingtips

TracerManagedSpanStatus currentManagedState = getCurrentManagedStatusForSpan(span);
switch(currentManagedState) {
  case MANAGED_CURRENT_ROOT_SPAN:
com.nike.wingtipsTracergetCurrentManagedStatusForSpan

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,
  • getCurrentSpanStackSize,
  • getCurrentTracingStateCopy

Popular in Java

  • Creating JSON documents from java classes using gson
  • startActivity (Activity)
  • getContentResolver (Context)
  • getSharedPreferences (Context)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • Kernel (java.awt.image)
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • JCheckBox (javax.swing)
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • 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