弹簧启动执行器-MAX属性 [英] Spring Boot Actuator - MAX property

查看:109
本文介绍了弹簧启动执行器-MAX属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Spring Boot Actuator依赖项来获取应用程序的见解.为此,我使用了Spring Boot Admin.客户端服务器的配置工作正常.我必须测量要执行的端点的计数,总时间,最大值.

I am using Spring Boot Actuator dependency to get insights of application. For that, I have used Spring Boot Admin. Configuration for client-server is working fine. I have to measure the count, total-time, max for endpoints which are going to execute.

uri:/user/asset/getAllAssets
TOTAL_TIME: 831ms
MAX: 0ms 

uri:/user/getEmployee/{employeeId}
TOTAL_TIME: 98ms
MAX: 0ms

为什么MAX(时间)为0而TOTAL_TIME:为Xms

Why MAX (time) is 0 while TOTAL_TIME: is Xms

我执行概括形式

localhost:8889/actuator/metrics/http.server.requests 我得到的 MAX为3.00 ..

localhost:8889/actuator/metrics/http.server.requests I get the MAX as 3.00..

我还看到了

I had also seen production-ready-features but not able to find any description about how MAX is calculated or what does it represent

注意: 随着请求数量的增加(COUNT个),TOTAL_TIME也有所增加,但MAX有时会减少 (有关详细信息,请参见请求1,请求2)

Notes: with the number of request in an increase, COUNT, TOTAL_TIME is also getting an increase but MAX is reducing sometimes (see Request 1, Request 2 for details)

 {
        "name": "http.server.requests",
        "description": null,
        "baseUnit": "seconds",
        "measurements": [
            {
                "statistic": "COUNT",
                "value": 597
            },
            {
                "statistic": "TOTAL_TIME",
                "value": 144.9057076
            },
            {
                "statistic": "MAX",
                "value": 3.0002913
            }
        ],
        "availableTags": [
            {
                "tag": "exception",
                "values": [
                    "None"
                ]
            },
            {
                "tag": "method",
                "values": [
                    "GET"
                ]
            },
            {
                "tag": "uri",
                "values": [
                    "/actuator/metrics/{requiredMetricName}",
                    "/**/favicon.ico",
                    "/actuator",
                    "/user/getEmployee/{employeeId}",
                    "/user/asset/getAllAssets",
                    "/actuator/health",
                    "/actuator/info",
                    "/actuator/env/{toMatch}",
                    "/actuator/metrics",
                    "/**"
                ]
            },
            {
                "tag": "outcome",
                "values": [
                    "CLIENT_ERROR",
                    "SUCCESS"
                ]
            },
            {
                "tag": "status",
                "values": [
                    "404",
                    "200"
                ]
            }
        ]
    }


更新


UPDATE

localhost:8889/actuator/metrics/http.server.requests?tag=uri:/user/getEmployee/2

localhost:8889/actuator/metrics/http.server.requests?tag=uri:/user/getEmployee/2

响应404 (我在请求执行器之前已经执行了/user/getEmployee/2)

localhost:8889/actuator/metrics/http.server.requests?tag=uri:/user/getEmployee/{employeeId}

localhost:8889/actuator/metrics/http.server.requests?tag=uri:/user/getEmployee/{employeeId}

响应400

localhost:8889/actuator/metrics/http.server.requests?tag=uri:/user/asset/getAllAssets

localhost:8889/actuator/metrics/http.server.requests?tag=uri:/user/asset/getAllAssets

{
    "name": "http.server.requests",
    "description": null,
    "baseUnit": "seconds",
    "measurements": [
        {
            "statistic": "COUNT",
            "value": 1
        },
        {
            "statistic": "TOTAL_TIME",
            "value": 0.8311609
        },
        {
            "statistic": "MAX",
            "value": 0
        }
    ],
    "availableTags": [
        {
            "tag": "exception",
            "values": [
                "None"
            ]
        },
        {
            "tag": "method",
            "values": [
                "GET"
            ]
        },
        {
            "tag": "outcome",
            "values": [
                "SUCCESS"
            ]
        },
        {
            "tag": "status",
            "values": [
                "200"
            ]
        }
    ]
}

请求2:http.server.requests

localhost:8889/actuator/metrics/http.server.requests

Request 2: http.server.requests

localhost:8889/actuator/metrics/http.server.requests

{
    "name": "http.server.requests",
    "description": null,
    "baseUnit": "seconds",
    "measurements": [
        {
            "statistic": "COUNT",
            "value": 3346
        },
        {
            "statistic": "TOTAL_TIME",
            "value": 559.7992767999998
        },
        {
            "statistic": "MAX",
            "value": 2.3612968
        }
    ],

推荐答案

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆