弹簧启动执行器-MAX属性 [英] Spring Boot Actuator - MAX property
问题描述
我正在使用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
}
],
推荐答案
- MAX代表什么
- What does MAX represent
MAX表示执行端点所需的最长时间.
MAX represents the maximum time taken to execute endpoint.
/user/asset/getAllAssets
COUNT TOTAL_TIME MAX
5 115 17
6 122 17 (Execution Time = 122 - 115 = 17)
7 131 17 (Execution Time = 131 - 122 = 17)
8 187 56 (Execution Time = 187 - 131 = 56)
9 204 56 From Now MAX will be 56 (Execution Time = 204 - 187 = 17)
- 如果对特定端点的请求数(或1个请求)减少,MAX将为0吗?
- Will MAX be 0 if we have less number of request (or 1 request) to the particular endpoint?
- 当MAX为0时
对特定端点的请求数量不影响MAX
No number of request for particular endPoint does not affect the MAX
为此,我采取了6个样本(对同一端点执行了6次).为此,我确定了调用端点的时间-MAX设置为零的时间之间的时间差
For that, I have taken 6 samples (executed the same endpoint for 6 times). For that, I have determined the time difference between the time of calling the endpoint - time for when MAX set back to zero
DistributionStatisticConfig has .expiry(Duration.ofMinutes(2)).bufferLength(3)
which sets some measurements to 0 if there is no request has been made in between expiry time or rotate time.
MAX 属性属于 测量 (在测量中,我们获得COUNT,TOTAL_TIME,MAX)
公共静态最终统计信息 MAX
记录的最大数量.当这代表一个时间时,它是 报告监视系统的基本时间单位.
The maximum amount recorded. When this represents a time, it is reported in the monitoring system's base unit of time.
注释:
这是来自特定端点(此处为/actuator/metrics/http.server.requests?tag=uri:/user/asset/getAllAssets
)的度量的情况.
Notes:
This is the cases from metric for a particular endpoint (here /actuator/metrics/http.server.requests?tag=uri:/user/asset/getAllAssets
).
用于actuator/metrics/http.server.requests
的通用度量
从请求1,请求2(有问题的)中可以看到,MAX减少了(从3.0002913减少到2.3612968)由于一个计时器.在我看来,/http.server.requests
的MAX将与特定端点相同. (但请确保对此进行调查)
As you can see from Request 1, Request 2 (in question) the MAX has been reduced (from 3.0002913 to 2.3612968) so that maybe because of MAX for some endPoint will be set backed to 0 due to a timer. In my view for MAX for /http.server.requests
will be same as a particular endpoint. (but sure on that, investigating on it)
这篇关于弹簧启动执行器-MAX属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!