com.nike.wingtips.Tracer.removeSpanLifecycleListener()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(7.6k)|赞(0)|评价(0)|浏览(131)

本文整理了Java中com.nike.wingtips.Tracer.removeSpanLifecycleListener()方法的一些代码示例,展示了Tracer.removeSpanLifecycleListener()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Tracer.removeSpanLifecycleListener()方法的具体详情如下:
包路径:com.nike.wingtips.Tracer
类名称:Tracer
方法名:removeSpanLifecycleListener

Tracer.removeSpanLifecycleListener介绍

[英]Returns the value of calling java.util.List#remove(Object) on #spanLifecycleListeners.
[中]返回调用java的值。util。在#spanLifecycleListeners上列出#删除(对象)。

代码示例

代码示例来源: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 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 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

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/riposte

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/riposte

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 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/riposte

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

@Test
public void removeSpanLifecycleListener_should_work_as_advertised() {
  // given
  SpanLifecycleListener listener = mock(SpanLifecycleListener.class);
  Tracer.getInstance().addSpanLifecycleListener(listener);
  assertThat(Tracer.getInstance().getSpanLifecycleListeners()).hasSize(1);
  assertThat(Tracer.getInstance().getSpanLifecycleListeners().get(0)).isEqualTo(listener);
  // when
  boolean result = Tracer.getInstance().removeSpanLifecycleListener(listener);
  // then
  assertThat(result).isTrue();
  assertThat(Tracer.getInstance().getSpanLifecycleListeners()).isEmpty();
}

代码示例来源:origin: Nike-Inc/wingtips

@Test
public void removeSpanLifecycleListener_should_return_false_and_do_nothing_if_passed_null() {
  // given
  SpanLifecycleListener listener = mock(SpanLifecycleListener.class);
  Tracer.getInstance().addSpanLifecycleListener(listener);
  assertThat(Tracer.getInstance().getSpanLifecycleListeners()).hasSize(1);
  assertThat(Tracer.getInstance().getSpanLifecycleListeners().get(0)).isEqualTo(listener);
  // when
  boolean result = Tracer.getInstance().removeSpanLifecycleListener(null);
  // then
  assertThat(result).isFalse();
  assertThat(Tracer.getInstance().getSpanLifecycleListeners()).hasSize(1);
  assertThat(Tracer.getInstance().getSpanLifecycleListeners().get(0)).isEqualTo(listener);
}

代码示例来源:origin: Nike-Inc/wingtips

public static void resetTracing() {
  MDC.clear();
  Tracer.getInstance().unregisterFromThread();
  List<SpanLifecycleListener> listeners = new ArrayList<>(Tracer.getInstance().getSpanLifecycleListeners());
  for (SpanLifecycleListener listener : listeners) {
    Tracer.getInstance().removeSpanLifecycleListener(listener);
  }
}

代码示例来源:origin: Nike-Inc/wingtips

private void resetTracing() {
  MDC.clear();
  Tracer.getInstance().unregisterFromThread();
  List<SpanLifecycleListener> listeners = new ArrayList<>(Tracer.getInstance().getSpanLifecycleListeners());
  for (SpanLifecycleListener listener : listeners) {
    Tracer.getInstance().removeSpanLifecycleListener(listener);
  }
}

代码示例来源:origin: Nike-Inc/wingtips

private void resetTracer() {
  Tracer.getInstance().completeRequestSpan();
  Tracer.getInstance().setRootSpanSamplingStrategy(new SampleAllTheThingsStrategy());
  for (SpanLifecycleListener listener : new ArrayList<>(Tracer.getInstance().getSpanLifecycleListeners())) {
    Tracer.getInstance().removeSpanLifecycleListener(listener);
  }
  Tracer.getInstance().setSpanLoggingRepresentation(Tracer.SpanLoggingRepresentation.JSON);
}

相关文章