spring-boot - 在 Spring Boot 指标中计算 AsyncResponse 调用
问题描述
我有一个用 Spring boot 2 编写的 JAX-RS 服务后端,并使用千分尺进行度量。默认情况下,这些指标包含非常好的 http 指标,如 http_server_requests_seconds_count。
这些对于正常的 GET 和 PUT 请求非常有用。不过,我的服务中的一种方法使用 JAX-RS AsyncRequest。
@GET
@Produces(APPLICATION_JSON)
@Path("next/{position}")
public void getNext(
@PathParam("position") Long position,
@Suspended final AsyncResponse response) throws InterruptedException {
...
// Somewhere in the code in another thread I invoke
response.resume(entity);
...
}
这些电话似乎根本没有被计算在内。有没有办法让他们计数?如果不是,我应该简单地从我的代码中手动输入相同的计数器吗?
解决方案
推荐阅读
- reactjs - 如何在材质 UI 中使用 withStyles 覆盖引导类
- excel - 索引匹配 与多个条件匹配
- html - 从 HTTP 迁移到 HTTPS
- ms-access - 通过复制现有表的结构创建 Access 表
- javascript - 连续加载localhost:3000
- reactjs - “错误:您试图在一个本应不可变且已被冻结的对象上设置键 `latitude` 的值为 `37.785834`。”
- node.js - 是否有任何功能可以为集合中的所有现有 mongodb 对象添加新属性
- javascript - 如何检查 Cloud Firestore 集合中的所有文档中是否存在字段值?
- java - Spring MVC 从 JSP 中的表单在 @Controller 中创建一个对象
- python - 使用 numpy 摆脱循环