kamon.Kamon类的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(5.7k)|赞(0)|评价(0)|浏览(98)

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

Kamon介绍

暂无

代码示例

代码示例来源:origin: apache/servicecomb-pack

@PreDestroy
 void shutdown() {
  Kamon.shutdown();
 }
}

代码示例来源:origin: apache/servicecomb-pack

public static void main(String[] args) {
 Kamon.start();
 SpringApplication.run(AlphaApplication.class, args);
}

代码示例来源:origin: org.eclipse.ditto/ditto-services-utils-metrics

private kamon.metric.Histogram getKamonInternalHistogram() {
  return Kamon.histogram(name).refine(tags);
}

代码示例来源:origin: eclipse/ditto

private kamon.metric.Timer getKamonInternalTimer() {
  return Kamon.timer(name).refine(this.tags);
}

代码示例来源:origin: eclipse/ditto

private void startKamon() {
  final Config kamonConfig = ConfigFactory.load("kamon");
  Kamon.reconfigure(kamonConfig);
  if (configReader.metrics().isSystemMetricsEnabled()) {
    // start system metrics collection
    SystemMetrics.startCollecting();
  }
  if (configReader.metrics().isPrometheusEnabled()) {
    // start prometheus reporter
    this.startPrometheusReporter();
  }
}

代码示例来源:origin: org.eclipse.ditto/ditto-services-base

private void startPrometheusReporter() {
  try {
    prometheusReporter = new PrometheusReporter();
    Kamon.addReporter(prometheusReporter);
    logger.info("Successfully added Prometheus reporter to Kamon.");
  } catch (final Throwable ex) {
    logger.error("Error while adding Prometheus reporter to Kamon.", ex);
  }
}

代码示例来源:origin: org.eclipse.ditto/ditto-services-utils-metrics

private kamon.metric.Counter getKamonInternalCounter() {
  return Kamon.counter(name).refine(this.tags);
}

代码示例来源:origin: org.eclipse.ditto/ditto-services-utils-metrics

private kamon.metric.Gauge getKamonInternalGauge() {
  return Kamon.gauge(name).refine(tags);
}

代码示例来源:origin: org.eclipse.ditto/ditto-services-amqpbridge-messaging

private void traceCommand(final Command<?> command) {
  command.getDittoHeaders().getCorrelationId().ifPresent(correlationId -> {
    final Option<String> token = Option.apply(correlationId);
    final TraceContext traceContext = Kamon.tracer().newContext("roundtrip.amqp_" + command.getType(), token);
    traceContext.addMetadata("command", command.getType());
    traces.put(correlationId, traceContext);
  });
}

代码示例来源:origin: eclipse/ditto

private kamon.metric.Histogram getKamonInternalHistogram() {
  return Kamon.histogram(name).refine(tags);
}

代码示例来源:origin: org.eclipse.ditto/ditto-services-utils-metrics

private kamon.metric.Timer getKamonInternalTimer() {
  return Kamon.timer(name).refine(this.tags);
}

代码示例来源:origin: org.eclipse.ditto/ditto-services-base

private void startKamon() {
  final Config kamonConfig = ConfigFactory.load("kamon");
  Kamon.reconfigure(kamonConfig);
  if (configReader.metrics().isSystemMetricsEnabled()) {
    // start system metrics collection
    SystemMetrics.startCollecting();
  }
  if (configReader.metrics().isPrometheusEnabled()) {
    // start prometheus reporter
    this.startPrometheusReporter();
  }
}

代码示例来源:origin: eclipse/ditto

private void startPrometheusReporter() {
  try {
    prometheusReporter = new PrometheusReporter();
    Kamon.addReporter(prometheusReporter);
    logger.info("Successfully added Prometheus reporter to Kamon.");
  } catch (final Throwable ex) {
    logger.error("Error while adding Prometheus reporter to Kamon.", ex);
  }
}

代码示例来源:origin: eclipse/ditto

private kamon.metric.Counter getKamonInternalCounter() {
  return Kamon.counter(name).refine(this.tags);
}

代码示例来源:origin: eclipse/ditto

private kamon.metric.Gauge getKamonInternalGauge() {
  return Kamon.gauge(name).refine(tags);
}

代码示例来源:origin: eclipse/ditto

private void persistThingEvents(final List<ThingEvent> thingEvents, final long targetRevision) {
  log.debug("Executing bulk write operation with <{}> updates.", thingEvents.size());
  if (!thingEvents.isEmpty()) {
    transactionActive = true;
    Kamon.histogram(COUNT_THING_BULK_UPDATES_PER_BULK).record(thingEvents.size());
    final StartedTimer bulkUpdate =
        DittoMetrics.expiringTimer(TRACE_THING_BULK_UPDATE).tag(UPDATE_TYPE_TAG, "bulkUpdate").build();
    circuitBreaker.callWithCircuitBreakerCS(() -> searchUpdaterPersistence
        .executeCombinedWrites(thingId, thingEvents, policyEnforcer, targetRevision)
        .via(stopTimer(bulkUpdate))
        .runWith(Sink.last(), materializer)
        .whenComplete(this::processWriteResult))
        .exceptionally(t -> {
          log.error(t, "There occurred an error while processing a write operation within the"
              + " circuit breaker for thing <{}>.", thingId);
          //e.g. in case of a circuit breaker timeout, the running transaction must be stopped
          processWriteResult(false, t);
          return null;
        });
  }
}

代码示例来源:origin: org.eclipse.ditto/ditto-services-utils-metrics

private kamon.metric.Timer getKamonInternalTimer() {
  return Kamon.timer(name).refine(this.tags);
}

代码示例来源:origin: org.eclipse.ditto/ditto-services-thingsearch-updater-actors

private void persistThingEvents(final List<ThingEvent> thingEvents, final long targetRevision) {
  log.debug("Executing bulk write operation with <{}> updates.", thingEvents.size());
  if (!thingEvents.isEmpty()) {
    transactionActive = true;
    Kamon.histogram(COUNT_THING_BULK_UPDATES_PER_BULK).record(thingEvents.size());
    final StartedTimer bulkUpdate =
        DittoMetrics.expiringTimer(TRACE_THING_BULK_UPDATE).tag(UPDATE_TYPE_TAG, "bulkUpdate").build();
    circuitBreaker.callWithCircuitBreakerCS(() -> searchUpdaterPersistence
        .executeCombinedWrites(thingId, thingEvents, policyEnforcer, targetRevision)
        .via(stopTimer(bulkUpdate))
        .runWith(Sink.last(), materializer)
        .whenComplete(this::processWriteResult))
        .exceptionally(t -> {
          log.error(t, "There occurred an error while processing a write operation within the"
              + " circuit breaker for thing <{}>.", thingId);
          //e.g. in case of a circuit breaker timeout, the running transaction must be stopped
          processWriteResult(false, t);
          return null;
        });
  }
}

代码示例来源:origin: eclipse/ditto

private kamon.metric.Timer getKamonInternalTimer() {
  return Kamon.timer(name).refine(this.tags);
}

相关文章

Kamon类方法