Tabnine Logo
WingtipsRequestSpanCompletionAsyncListener.completeRequestSpan
Code IndexAdd Tabnine to your IDE (free)

How to use
completeRequestSpan
method
in
com.nike.wingtips.servlet.WingtipsRequestSpanCompletionAsyncListener

Best Java code snippets using com.nike.wingtips.servlet.WingtipsRequestSpanCompletionAsyncListener.completeRequestSpan (Showing top 5 results out of 315)

origin: Nike-Inc/wingtips

@Override
public void onComplete(AsyncEvent event) {
  completeRequestSpan(event);
}
origin: Nike-Inc/wingtips

@Test
public void completeRequestSpan_does_nothing_if_listener_is_already_marked_completed() {
  // given
  implSpy.alreadyCompleted.set(true);
  assertThat(tracingStateSpan.isCompleted()).isFalse();
  // when
  implSpy.completeRequestSpan(asyncEventMock);
  // then
  assertThat(tracingStateSpan.isCompleted()).isFalse();
  assertThat(implSpy.alreadyCompleted.get()).isTrue();
}

origin: Nike-Inc/wingtips

@Test
public void onComplete_calls_completeRequestSpan_and_does_nothing_else() {
  // when
  implSpy.onComplete(asyncEventMock);
  // then
  verify(implSpy).onComplete(asyncEventMock);
  verify(implSpy).completeRequestSpan(asyncEventMock);
  verifyNoMoreInteractions(implSpy);
}
origin: Nike-Inc/wingtips

@Test
public void completeRequestSpan_marks_listener_as_completed_even_if_unexpected_exception_occurs() {
  // given
  Tracer.getInstance().startRequestWithRootSpan("someOtherUnrelatedSpan");
  TracingState unrelatedThreadTracingState = TracingState.getCurrentThreadTracingState();
  final RuntimeException expectedExplosion = new RuntimeException("kaboom");
  SpanRecorder explodingSpanRecorder = new SpanRecorder() {
    @Override
    public void spanCompleted(Span span) {
      throw expectedExplosion;
    }
  };
  Tracer.getInstance().addSpanLifecycleListener(explodingSpanRecorder);
  assertThat(implSpy.alreadyCompleted.get()).isFalse();
  // when
  Throwable actualEx = catchThrowable(() -> implSpy.completeRequestSpan(asyncEventMock));
  // then
  assertThat(actualEx).isSameAs(expectedExplosion);
  assertThat(explodingSpanRecorder.completedSpans).hasSize(0);
  assertThat(implSpy.alreadyCompleted.get()).isTrue();
  // Tracing state got reset back to original from when the method was called.
  assertThat(TracingState.getCurrentThreadTracingState()).isEqualTo(unrelatedThreadTracingState);
}
origin: Nike-Inc/wingtips

implSpy.completeRequestSpan(asyncEventMock);
com.nike.wingtips.servletWingtipsRequestSpanCompletionAsyncListenercompleteRequestSpan

Javadoc

Does the work of doing the final span tagging and naming, and completes the span for #originalRequestTracingState. The request, response, and any error needed for the tagging/naming are pulled from the given AsyncEvent. This method is configured to only ever execute once (via the #alreadyCompleted atomic boolean) - subsequent calls will return immediately without doing anything.

Popular methods of WingtipsRequestSpanCompletionAsyncListener

  • <init>
  • onComplete
  • onError
  • onStartAsync
  • onTimeout

Popular in Java

  • Making http post requests using okhttp
  • setContentView (Activity)
  • addToBackStack (FragmentTransaction)
  • getSupportFragmentManager (FragmentActivity)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • BoxLayout (javax.swing)
  • 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