[英]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.