Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/60.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何使用千分尺测量每秒http请求数_Java_Rest_Instrumentation_Statsd_Micrometer - Fatal编程技术网

Java 如何使用千分尺测量每秒http请求数

Java 如何使用千分尺测量每秒http请求数,java,rest,instrumentation,statsd,micrometer,Java,Rest,Instrumentation,Statsd,Micrometer,我们有一个使用vert.x开发的rest服务,每秒都有大量的请求。我使用StatsdMeterRegistry作为其他指标,如计时器,以测量处理不同业务逻辑所采取的措施。如何使用千分尺测量每秒出现的http请求。在我的本地,我已经安装了statsd代理和碳/石墨/耳语,但在生产中将安装statsd和sysdig。不使用spring框架或spring引导。我不能使用vertx内置的测微计支架,因为它不支持statsd。测微计是否为http请求速率提供内置仪表。或者你能建议的任何不同的方式 千分尺是

我们有一个使用vert.x开发的rest服务,每秒都有大量的请求。我使用StatsdMeterRegistry作为其他指标,如计时器,以测量处理不同业务逻辑所采取的措施。如何使用千分尺测量每秒出现的http请求。在我的本地,我已经安装了statsd代理和碳/石墨/耳语,但在生产中将安装statsd和sysdig。不使用spring框架或spring引导。我不能使用vertx内置的测微计支架,因为它不支持statsd。测微计是否为http请求速率提供内置仪表。或者你能建议的任何不同的方式

千分尺是度量的一个简单外观。您应该能够利用内置测微计支持,只需插入正确的后端即可

以下是创建statsd注册表并向vertx注册的方法:

StatsdConfig config = new StatsdConfig() {
    @Override
    public String get(String k) {
        return null;
    }


    @Override
    public StatsdFlavor flavor() {
        return StatsdFlavor.Etsy;
    }
};

MeterRegistry registry = new StatsdMeterRegistry(config, Clock.SYSTEM);

Vertx vertx = Vertx.vertx(new VertxOptions()
  .setMetricsOptions(new MicrometerMetricsOptions()
    .setMicrometerRegistry(registry)
    .setEnabled(true)));
文件:
而且

非常感谢。这会有帮助。没有像setMillimorRegistry这样的方法。文档中提到了这种方法。我唯一的猜测是你需要升级Vertx版本