[英]How to log complete Request /Response of aws api gateway rest api?
[英]How to measure complete response time (request in to response received by client ) in Play! framework?
我是playframework的新用户。 在我的一个项目中,我想测量从发出HTTP请求到客户端收到响应的最后一个字节要花费多长时间。 我称这段时间为“响应时间”。 在网络日志中,我可以看到:
2016-11-17 10:32:00,712 [DEBUG] from io.netty.handler.logging.LoggingHandler in netty-event-loop-3 - [id: 0xb4fb943a, L:/127.0.0.1:9001 - R:/127.0.0.1:50871] WRITE: DefaultFullHttpResponse(decodeResult: success, version: HTTP/1.1, content: ReadOnlyByteBufferBuf(ridx: 0, widx: 655, cap: 655/655))
2016-11-17 10:32:00,713 [DEBUG] from io.netty.handler.logging.LoggingHandler in netty-event-loop-3 - [id: 0xb4fb943a, L:/127.0.0.1:9001 - R:/127.0.0.1:50871] FLUSH
2016-11-17 10:32:00,713 [DEBUG] from io.netty.handler.logging.LoggingHandler in netty-event-loop-3 - [id: 0xb4fb943a, L:/127.0.0.1:9001 - R:/127.0.0.1:50871] FLUSH
2016-11-17 10:37:19,311 [DEBUG] from io.netty.handler.logging.LoggingHandler in netty-event-loop-3 - [id: 0xb4fb943a, L:/127.0.0.1:9001 ! R:/127.0.0.1:50871] INACTIVE
2016-11-17 10:37:19,312 [DEBUG] from io.netty.handler.logging.LoggingHandler in netty-event-loop-3 - [id: 0xb4fb943a, L:/127.0.0.1:9001 ! R:/127.0.0.1:50871] UNREGISTERED
我可以从日志中获取响应时间(从WRITE到FLUSH?),但是有什么方法可以更轻松地获取“响应时间”吗? 我需要的是将“响应时间”作为度量标准进行度量并将其记录或发送给Grafana。
感谢大家!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.