- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中com.nike.wingtips.zipkin.util.ZipkinSpanSender
类的一些代码示例,展示了ZipkinSpanSender
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZipkinSpanSender
类的具体详情如下:
包路径:com.nike.wingtips.zipkin.util.ZipkinSpanSender
类名称:ZipkinSpanSender
[英]A interface for sending Zipkin spans to a Zipkin server. This is similar to a Zipkin SpanCollector and you can easily create an adapter that wraps a native Zipkin Brave SpanCollector with this interface if you prefer the features, flexibility, and numerous transport options provided by the native Zipkin SpanCollectors over the no-dependencies HTTP-only default implementation provided by ZipkinSpanSenderDefaultHttpImpl.
[中]用于将Zipkin跨度发送到Zipkin服务器的接口。这类似于Zipkin SpanCollector,您可以轻松创建一个适配器,将本机Zipkin{{0$}SpanCollector包装在这个接口中,如果您喜欢它的功能、灵活性,本机Zipkin SpanCollectors通过ZipkinPansenderDefaultHttpImpl提供的无依赖HTTP纯默认实现提供了许多传输选项。
代码示例来源:origin: Nike-Inc/wingtips
@Override
public void spanCompleted(Span span) {
try {
zipkin.Span zipkinSpan = zipkinSpanConverter.convertWingtipsSpanToZipkinSpan(span, zipkinEndpoint, localComponentNamespace);
zipkinSpanSender.handleSpan(zipkinSpan);
}
catch(Throwable ex) {
long currentBadSpanCount = spanHandlingErrorCounter.incrementAndGet();
// Only log once every MIN_SPAN_HANDLING_ERROR_LOG_INTERVAL_MILLIS time interval to prevent log spam from a malicious (or broken) caller.
long currentTimeMillis = System.currentTimeMillis();
long timeSinceLastLogMsgMillis = currentTimeMillis - lastSpanHandlingErrorLogTimeEpochMillis;
if (timeSinceLastLogMsgMillis >= MIN_SPAN_HANDLING_ERROR_LOG_INTERVAL_MILLIS) {
// We're not synchronizing the read and write to lastSpanHandlingErrorLogTimeEpochMillis, and that's ok. If we get a few extra
// log messages due to a race condition it's not the end of the world - we're still satisfying the goal of not allowing a
// malicious caller to endlessly spam the logs.
lastSpanHandlingErrorLogTimeEpochMillis = currentTimeMillis;
zipkinConversionOrReportingErrorLogger.warn(
"There have been {} spans that were not zipkin compatible, or that experienced an error during span handling. Latest example: "
+ "wingtips_span_with_error=\"{}\", conversion_or_handling_error=\"{}\"",
currentBadSpanCount, span.toKeyValueString(), ex.toString());
}
}
}
}
代码示例来源:origin: com.nike.wingtips/wingtips-zipkin
@Override
public void spanCompleted(Span span) {
try {
zipkin.Span zipkinSpan = zipkinSpanConverter.convertWingtipsSpanToZipkinSpan(span, zipkinEndpoint, localComponentNamespace);
zipkinSpanSender.handleSpan(zipkinSpan);
}
catch(Throwable ex) {
long currentBadSpanCount = spanHandlingErrorCounter.incrementAndGet();
// Only log once every MIN_SPAN_HANDLING_ERROR_LOG_INTERVAL_MILLIS time interval to prevent log spam from a malicious (or broken) caller.
long currentTimeMillis = System.currentTimeMillis();
long timeSinceLastLogMsgMillis = currentTimeMillis - lastSpanHandlingErrorLogTimeEpochMillis;
if (timeSinceLastLogMsgMillis >= MIN_SPAN_HANDLING_ERROR_LOG_INTERVAL_MILLIS) {
// We're not synchronizing the read and write to lastSpanHandlingErrorLogTimeEpochMillis, and that's ok. If we get a few extra
// log messages due to a race condition it's not the end of the world - we're still satisfying the goal of not allowing a
// malicious caller to endlessly spam the logs.
lastSpanHandlingErrorLogTimeEpochMillis = currentTimeMillis;
zipkinConversionOrReportingErrorLogger.warn(
"There have been {} spans that were not zipkin compatible, or that experienced an error during span handling. Latest example: "
+ "wingtips_span_with_error=\"{}\", conversion_or_handling_error=\"{}\"",
currentBadSpanCount, span.toKeyValueString(), ex.toString());
}
}
}
}
代码示例来源:origin: Nike-Inc/wingtips
@Test
public void spanCompleted_does_not_propagate_exceptions_generated_by_span_sender() {
// given
doThrow(new RuntimeException("kaboom")).when(spanSenderMock).handleSpan(any(zipkin.Span.class));
// when
Throwable ex = catchThrowable(new ThrowableAssert.ThrowingCallable() {
@Override
public void call() throws Throwable {
listener.spanCompleted(spanMock);
}
});
// then
verify(spanSenderMock).handleSpan(any(zipkin.Span.class));
assertThat(ex).isNull();
}
代码示例来源:origin: Nike-Inc/wingtips
@Test
public void spanCompleted_logs_error_during_handling_if_time_since_lastSpanHandlingErrorLogTimeEpochMillis_is_greater_than_MIN_SPAN_HANDLING_ERROR_LOG_INTERVAL_MILLIS() throws InterruptedException {
// given
Logger loggerMock = mock(Logger.class);
Whitebox.setInternalState(listener, "zipkinConversionOrReportingErrorLogger", loggerMock);
long lastLogTimeToSet = System.currentTimeMillis() - (MIN_SPAN_HANDLING_ERROR_LOG_INTERVAL_MILLIS + 10);
Whitebox.setInternalState(listener, "lastSpanHandlingErrorLogTimeEpochMillis", lastLogTimeToSet);
doThrow(new RuntimeException("kaboom")).when(spanSenderMock).handleSpan(any(zipkin.Span.class));
// when
long before = System.currentTimeMillis();
listener.spanCompleted(spanMock);
long after = System.currentTimeMillis();
// then
verify(loggerMock).warn(anyString(), anyLong(), anyString(), anyString());
// Also verify that the lastSpanHandlingErrorLogTimeEpochMillis value got updated.
assertThat((long)Whitebox.getInternalState(listener, "lastSpanHandlingErrorLogTimeEpochMillis")).isBetween(before, after);
}
代码示例来源:origin: Nike-Inc/wingtips
@Test
public void spanCompleted_does_not_log_an_error_during_handling_if_time_since_lastSpanHandlingErrorLogTimeEpochMillis_is_less_than_MIN_SPAN_HANDLING_ERROR_LOG_INTERVAL_MILLIS() throws InterruptedException {
// given
Logger loggerMock = mock(Logger.class);
Whitebox.setInternalState(listener, "zipkinConversionOrReportingErrorLogger", loggerMock);
long lastLogTimeToSet = System.currentTimeMillis() - (MIN_SPAN_HANDLING_ERROR_LOG_INTERVAL_MILLIS - 1000);
Whitebox.setInternalState(listener, "lastSpanHandlingErrorLogTimeEpochMillis", lastLogTimeToSet);
doThrow(new RuntimeException("kaboom")).when(spanSenderMock).handleSpan(any(zipkin.Span.class));
// when
listener.spanCompleted(spanMock);
// then
verifyZeroInteractions(loggerMock);
// Also verify that the lastSpanHandlingErrorLogTimeEpochMillis value was *not* updated.
assertThat((long)Whitebox.getInternalState(listener, "lastSpanHandlingErrorLogTimeEpochMillis")).isEqualTo(lastLogTimeToSet);
}
}
代码示例来源:origin: Nike-Inc/wingtips
@Test
public void spanCompleted_converts_to_zipkin_span_and_passes_it_to_zipkinSpanSender() {
// given
zipkin.Span zipkinSpan = zipkin.Span.builder().traceId(42).id(4242).name("foo").build();
doReturn(zipkinSpan).when(spanConverterMock).convertWingtipsSpanToZipkinSpan(any(Span.class), any(Endpoint.class), any(String.class));
// when
listener.spanCompleted(spanMock);
// then
verify(spanConverterMock).convertWingtipsSpanToZipkinSpan(spanMock, listener.zipkinEndpoint, localComponentNamespace);
verify(spanSenderMock).handleSpan(zipkinSpan);
}
本文整理了Java中com.nike.wingtips.tags.ZipkinHttpTagStrategy类的一些代码示例,展示了ZipkinHttpTagStrategy类的具体用法。这些代码示例
本文整理了Java中com.nike.wingtips.zipkin.util.ZipkinSpanSenderDefaultHttpImpl类的一些代码示例,展示了ZipkinSpanSenderD
本文整理了Java中com.nike.wingtips.zipkin.util.ZipkinSpanSender类的一些代码示例,展示了ZipkinSpanSender类的具体用法。这些代码示例主要来
适用于 iOS 5 的全新 Nike+ GPS 应用程序能够在后台处理加速度计事件(从而允许室内运行机跟踪)。这怎么可能?当我将应用程序置于后台时,它会停止接收事件。我使用标准的 UIAccelero
适用于 iOS 5 的新 Nike+ GPS 应用程序能够在后台处理加速度计事件(从而允许进行室内运行机跟踪)。这怎么可能?当我将我的应用程序置于后台时,它停止接收事件。我使用标准的 UIAccele
本文整理了Java中com.nike.wingtips.tags.ZipkinHttpTagStrategy.putTagIfValueIsNotBlank()方法的一些代码示例,展示了ZipkinH
本文整理了Java中com.nike.wingtips.tags.ZipkinHttpTagStrategy.getDefaultInstance()方法的一些代码示例,展示了ZipkinHttpTa
如何将我的应用程序与 iPhone 4G 的 Nike+ 功能集成。我想访问捕获的数据并将其发送到我自己的应用程序。关于该主题的可用信息似乎有限。非常感谢任何帮助。 最佳答案 我实际上创建了一个 PH
这是一个非常简短的问题,有人知道是否有用于以下转换的 Jquery 插件:http://www.nikesnowboarding.com/team “点击名称”或有人知道如何实现。如果一个人精通 Ja
本文整理了Java中com.nike.wingtips.zipkin.util.ZipkinSpanSenderDefaultHttpImpl.()方法的一些代码示例,展示了ZipkinSpanSen
本文整理了Java中com.nike.wingtips.zipkin.util.ZipkinSpanSenderDefaultHttpImpl.configureScheduledExecutorSe
本文整理了Java中com.nike.wingtips.zipkin.util.ZipkinSpanSender.handleSpan()方法的一些代码示例,展示了ZipkinSpanSender.h
StackOverflow 上有几个关于此的问题,但他们都声称这是不可能的,您只能通过在您的应用程序中显示自定义设置页面来做到这一点。然而,Nike+应用程序完全符合我的要求,如下所示: 那么,再一次
我目前正在尝试使用 python 中的 headless 浏览器进行一些质量检查/表单提交,我认为我的图书馆无法提交/完成表单。我在这里做错了什么? import mechanize import c
我无法从文档中看到这是如何实现的,但耐克正在他们的应用程序中这样做,所以一定有办法。 最佳答案 不幸的是,这是不可能的。苹果为耐克开发了它,所以他们使用了自己的技巧来做到这一点。它实际上可能是可能的,
我是一名优秀的程序员,十分优秀!