com.codahale.metrics.graphite.Graphite.send()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(1.8k)|赞(0)|评价(0)|浏览(129)

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

Graphite.send介绍

暂无

代码示例

代码示例来源:origin: HubSpot/Singularity

@Override
  public void send(String name, String value, long timestamp) throws IOException {
    if (!tags.isEmpty()) {
      name += '[' + JavaUtils.COMMA_EQUALS_MAP_JOINER.join(tags) + ']';
    }
    super.send(name, value, timestamp);
  }
}

代码示例来源:origin: com.opentable.components/otj-metrics-core

@Override
public synchronized void send(String name, String value, long timestamp) throws IOException {
  delegate.send(name, value, timestamp);
}

代码示例来源:origin: com.hubspot/SingularityService

@Override
  public void send(String name, String value, long timestamp) throws IOException {
    if (!tags.isEmpty()) {
      name += '[' + JavaUtils.COMMA_EQUALS_MAP_JOINER.join(tags) + ']';
    }
    super.send(name, value, timestamp);
  }
}

代码示例来源:origin: ru.yandex.qatools.camelot.utils/plugin-utils

@Processor
  public void process(GraphiteValue event) {
    if (isBlank(host)) {
      return;
    }

    logger.info(format("Sending %s to graphite at %s:%d", event, host, port));
    try {
      Graphite graphite = new Graphite(new InetSocketAddress(host, port));
      graphite.connect();
      graphite.send(event.getName(), event.getValue(), event.getTimestamp());
      graphite.close();
    } catch (IOException e) {
      logger.error("Failed to stream value to graphite:", e);
    }
  }
}

代码示例来源:origin: aseigneurin/kafka-sandbox

public void send(CounterMetric metric) {
  try {
    if (!graphite.isConnected()) {
      graphite.connect();
    }
    graphite.send(metric.getName() + ".count", Long.toString(metric.getValue()), metric.getTimestampInMillis());
    graphite.flush();
  } catch (IOException e) {
    LOGGER.warn("Unable to report to Graphite", graphite, e);
    try {
      graphite.close();
    } catch (IOException e1) {
      LOGGER.warn("Error closing Graphite", graphite, e);
    }
  }
}

相关文章