Spring 执行器 http.server.requests 统计的单位是什么

What is the unit for the Spring actuator http.server.requests statistic

我使用 spring-boot-starter-2.0.0.RELEASE 实现了服务。我已经为它启用了执行器指标,但是我不明白指标的单位是什么。具体来说,我对 http.server.requests.

感兴趣

端点的样本输出是:

{
    "name": "http.server.requests",
    "measurements": [
        {
            "statistic": "COUNT",
            "value": 2
        },
        {
            "statistic": "TOTAL_TIME",
            "value": 0.049653001
        },
        {
            "statistic": "MAX",
            "value": 0.040696019
        }
    ],
    "availableTags": [
        {
            "tag": "exception",
            "values": [
                "None"
            ]
        },
        {
            "tag": "method",
            "values": [
                "GET"
            ]
        },
        {
            "tag": "status",
            "values": [
                "200"
            ]
        }
    ]
}

截至目前(Spring-Boot:2.0.0 和 Micrometer:1.0.2)不幸的答案是:这取决于。

/actuator/metrics 端点由应用程序中当前活动的 MeterRegistry 实现支持。此实现定义了显示定时信息的时间 base-unit。 例如。如果您仅在类路径中获得 micrometer-registry-prometheus,则 /acturor/metrics 端点将在 seconds. If you got e.g. micromter-registry-graphite, the endpoint will serve in milliseconds (It's backed by DropwizardMeterRegistry.). If you got no "special" MeterRegistry implementation attracted, the SimpleMeterRegistry will become the backing registry and will serve seconds.

中提供计时信息

更糟糕的是,如果您有多个 MeterRegistry 实现,第一个在 CompositeMeterRegistry 注册的实现将被选为服务于 /actuator/metrics 的后备实现端点。

免责声明:信息已收集 from/with jkschneiderMicrometer.

的维护者