• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Reporter类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中zipkin2.reporter.Reporter的典型用法代码示例。如果您正苦于以下问题:Java Reporter类的具体用法?Java Reporter怎么用?Java Reporter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Reporter类属于zipkin2.reporter包,在下文中一共展示了Reporter类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: spanReporter

import zipkin2.reporter.Reporter; //导入依赖的package包/类
/** @deprecated please use {@link #spanReporterV2(Reporter)}}
 *
 * @param reporter a V1 reporter
 *
 * @return the config
 * */
@Deprecated
public Config spanReporter(final zipkin.reporter.Reporter<zipkin.Span> reporter) {
  if (reporter == zipkin.reporter.Reporter.NOOP) {
    this.spanReporter = Reporter.NOOP;
    return this;
  }
  this.spanReporter = new Reporter<zipkin2.Span>() {
    @Override public void report(zipkin2.Span span) {
      reporter.report(zipkin.internal.V2SpanConverter.toSpan(span));
    }

    @Override public String toString() {
      return reporter.toString();
    }
  };
  return this;
}
 
开发者ID:hyleung,项目名称:ratpack-zipkin,代码行数:24,代码来源:ServerTracingModule.java


示例2: setup

import zipkin2.reporter.Reporter; //导入依赖的package包/类
@Before
@SuppressWarnings("unchecked")
public void setup() {
	Endpoint localEndpoint = Endpoint.newBuilder().serviceName("testClient").build();

	clientReporter = Mockito.mock(Reporter.class);
	Tracing clientTracing = Tracing.newBuilder()
			.spanReporter(clientReporter)
			.localEndpoint(localEndpoint)
			.build();

	client = new CrnkClient(getBaseUri().toString());
	client.setHttpAdapter(httpAdapter);
	client.addModule(BraveClientModule.create(clientTracing));
	taskRepo = client.getRepositoryForType(Task.class);
	TaskRepository.clear();
	ProjectRepository.clear();
	httpAdapter.setReceiveTimeout(10000, TimeUnit.SECONDS);
}
 
开发者ID:crnk-project,项目名称:crnk-framework,代码行数:20,代码来源:AbstractBraveModuleTest.java


示例3: TestApplication

import zipkin2.reporter.Reporter; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public TestApplication() {
	property(CrnkProperties.RESOURCE_SEARCH_PACKAGE, getClass().getPackage().getName());
	property(CrnkProperties.RESOURCE_DEFAULT_DOMAIN, "http://test.local");

	serverReporter = Mockito.mock(Reporter.class);

	Tracing tracing = Tracing.newBuilder()
			.localServiceName("testServer")
			.spanReporter(serverReporter)
			.build();

	CrnkFeature feature = new CrnkFeature();
	feature.addModule(BraveServerModule.create(tracing));
	register(feature);
}
 
开发者ID:crnk-project,项目名称:crnk-framework,代码行数:17,代码来源:AbstractBraveModuleTest.java


示例4: zipkinReporter

import zipkin2.reporter.Reporter; //导入依赖的package包/类
@Bean
Reporter<Span> zipkinReporter(Sender sender) {
  if (apiVersion.compareTo(CONFIG_TRACING_COLLECTOR_API_V1) == 0){
    return AsyncReporter.builder(sender).build(SpanBytesEncoder.JSON_V1);
  }

  return AsyncReporter.builder(sender).build();
}
 
开发者ID:apache,项目名称:incubator-servicecomb-java-chassis,代码行数:9,代码来源:TracingConfiguration.java


示例5: tracing

import zipkin2.reporter.Reporter; //导入依赖的package包/类
@Bean
Tracing tracing(Reporter<Span> reporter, DynamicProperties dynamicProperties,
    CurrentTraceContext currentTraceContext) {
  return Tracing.newBuilder()
      .localServiceName(dynamicProperties.getStringProperty(CONFIG_QUALIFIED_MICROSERVICE_NAME_KEY,
          DEFAULT_MICROSERVICE_NAME))
      .currentTraceContext(currentTraceContext) // puts trace IDs into logs
      .spanReporter(reporter)
      .build();
}
 
开发者ID:apache,项目名称:incubator-servicecomb-java-chassis,代码行数:11,代码来源:TracingConfiguration.java


示例6: build

import zipkin2.reporter.Reporter; //导入依赖的package包/类
/**
 * Build a new {@link HttpTracing} instance for interfacing with Zipkin
 *
 * @param environment
 *            Environment
 * @return HttpTracing instance
 */
@Override
public Optional<HttpTracing> build(@Nonnull final Environment environment) {
    if (!isEnabled()) {
        LOGGER.warn("Zipkin tracing is disabled");
        return Optional.empty();
    }

    LOGGER.info("Sending spans to console");
    return buildTracing(environment, Reporter.CONSOLE);
}
 
开发者ID:smoketurner,项目名称:dropwizard-zipkin,代码行数:18,代码来源:ConsoleZipkinFactory.java


示例7: build

import zipkin2.reporter.Reporter; //导入依赖的package包/类
/**
 * Build a new {@link HttpTracing} instance for interfacing with Zipkin
 *
 * @param environment
 *            Environment
 * @return HttpTracing instance
 */
@Override
public Optional<HttpTracing> build(@Nonnull final Environment environment) {
    if (!isEnabled()) {
        LOGGER.warn("Zipkin tracing is disabled");
        return Optional.empty();
    }

    LOGGER.info("Dropping all collected spans");
    return buildTracing(environment, Reporter.NOOP);
}
 
开发者ID:smoketurner,项目名称:dropwizard-zipkin,代码行数:18,代码来源:EmptyZipkinFactory.java


示例8: buildTracing

import zipkin2.reporter.Reporter; //导入依赖的package包/类
/**
 * Build a new {@link HttpTracing} instance for interfacing with Zipkin
 *
 * @param environment
 *            Environment
 * @param reporter
 *            reporter
 * @return HttpTracing instance
 */
protected Optional<HttpTracing> buildTracing(
        @Nonnull final Environment environment,
        @Nonnull final Reporter<Span> reporter) {

    LOGGER.info("Registering Zipkin service ({}) at <{}:{}>", serviceName,
            serviceHost, servicePort);

    final Endpoint endpoint = Endpoint.newBuilder().ip(serviceHost)
            .port(servicePort).serviceName(serviceName).build();

    final Tracing tracing = Tracing.newBuilder()
            .currentTraceContext(MDCCurrentTraceContext.create())
            .localEndpoint(endpoint).spanReporter(reporter)
            .sampler(getSampler()).traceId128Bit(traceId128Bit).build();

    final HttpTracing httpTracing = HttpTracing.newBuilder(tracing)
            .clientParser(clientParser).clientSampler(clientSampler)
            .serverParser(serverParser).serverSampler(serverSampler)
            .build();

    // Register the tracing feature for client and server requests
    environment.jersey().register(TracingFeature.create(httpTracing));
    environment.lifecycle().manage(new Managed() {
        @Override
        public void start() throws Exception {
            // nothing to start
        }

        @Override
        public void stop() throws Exception {
            tracing.close();
        }
    });

    return Optional.of(httpTracing);
}
 
开发者ID:smoketurner,项目名称:dropwizard-zipkin,代码行数:46,代码来源:AbstractZipkinFactory.java


示例9: spanReporter

import zipkin2.reporter.Reporter; //导入依赖的package包/类
@Bean
@ConditionalOnProperty(value = "sample.zipkin.enabled", havingValue = "false")
public Reporter<Span> spanReporter() {
	return new Reporter<Span>() {
		@Override
		public void report(Span span) {
			logger.info(span);
		}
	};
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-sleuth,代码行数:11,代码来源:SampleRibbonApplication.java


示例10: reporter

import zipkin2.reporter.Reporter; //导入依赖的package包/类
/**
 * Accepts a sender so you can plug-in any standard one. Returns a Reporter so you can also
 * replace with a standard one.
 */
@Bean
@ConditionalOnMissingBean
public Reporter<Span> reporter(
		SpanMetricReporter spanMetricReporter,
		ZipkinProperties zipkin,
		Sender sender
) {
	return AsyncReporter.builder(sender)
			.queuedMaxSpans(1000) // historical constraint. Note: AsyncReporter supports memory bounds
			.messageTimeout(zipkin.getMessageTimeout(), TimeUnit.SECONDS)
			.metrics(new ReporterMetricsAdapter(spanMetricReporter))
			.build(zipkin.getEncoder());
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-sleuth,代码行数:18,代码来源:ZipkinAutoConfiguration.java


示例11: ZipkinSpanReporter

import zipkin2.reporter.Reporter; //导入依赖的package包/类
public ZipkinSpanReporter(Reporter<zipkin2.Span> reporter, EndpointLocator endpointLocator,
		Environment environment, List<SpanAdjuster> spanAdjusters) {
	this.reporter = reporter;
	this.endpointLocator = endpointLocator;
	this.environment = environment;
	this.spanAdjusters = spanAdjusters;
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-sleuth,代码行数:8,代码来源:ZipkinSpanReporter.java


示例12: create

import zipkin2.reporter.Reporter; //导入依赖的package包/类
public static Reporter<Span> create(String address) {
  return new XRayUDPReporter(XRayUDPStorage.newBuilder().address(address).build());
}
 
开发者ID:openzipkin,项目名称:zipkin-aws,代码行数:4,代码来源:XRayUDPReporter.java


示例13: spanReporter

import zipkin2.reporter.Reporter; //导入依赖的package包/类
@Bean
@ConditionalOnProperty(value = "sample.zipkin.enabled", havingValue = "false")
public Reporter<Span> spanReporter() {
	return Reporter.CONSOLE;
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-sleuth,代码行数:6,代码来源:SampleZipkinApplication.java


示例14: integrationTestZipkinSpanReporter

import zipkin2.reporter.Reporter; //导入依赖的package包/类
@Bean
Reporter<Span> integrationTestZipkinSpanReporter() {
	return new IntegrationTestZipkinSpanReporter();
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-sleuth,代码行数:5,代码来源:MessagingApplicationTests.java


示例15: zipkinSpanListener

import zipkin2.reporter.Reporter; //导入依赖的package包/类
@Bean
public SpanReporter zipkinSpanListener(Reporter<Span> reporter, EndpointLocator endpointLocator,
		Environment environment) {
	return new ZipkinSpanReporter(reporter, endpointLocator, environment, this.spanAdjusters);
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-sleuth,代码行数:6,代码来源:ZipkinAutoConfiguration.java


示例16: reporter

import zipkin2.reporter.Reporter; //导入依赖的package包/类
@Bean
public Reporter<zipkin2.Span> reporter() {
	return this.zipkinSpans::add;
}
 
开发者ID:spring-cloud,项目名称:spring-cloud-sleuth,代码行数:5,代码来源:ZipkinSpanReporterTests.java


示例17: spanReporterV2

import zipkin2.reporter.Reporter; //导入依赖的package包/类
/**
 * Set the Span reporter.
 *
 * If not set, defaults to {@link Reporter#NOOP}.
 *
 * @param reporter a V2 reporter
 *
 * @return the config
 */
public Config spanReporterV2(final Reporter<Span> reporter) {
  this.spanReporter = reporter;
  return this;
}
 
开发者ID:hyleung,项目名称:ratpack-zipkin,代码行数:14,代码来源:ServerTracingModule.java



注:本文中的zipkin2.reporter.Reporter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java FeatureInfo类代码示例发布时间:2022-05-23
下一篇:
Java FactoryImpl类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap