Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge #6073: feat: add logging for RPC HTTP requests: command, user, …
…http-code, time of running 1a691bd feat: add logging for RPC HTTP requests: command, user, http-code, time of running (Konstantin Akimov) Pull request description: ## Issue being fixed or feature implemented Currently there is no way to gather stats for http rpc in dash core. This PR aim to change it. ## What was done? Implemented some basic stats for each RPC request: - rpc command - flag "is external" - http status - time to serve query (rpc time, not http time) ## How Has This Been Tested? See new logs: ```log [httpworker.0] [httprpc.cpp:100] [~RpcHttpRequest] -- HTTP RPC request handled: user=platform-user command=getbestblockhash is_external=false status=200 elapsed_time_ms=0 [httpworker.2] [httprpc.cpp:100] [~RpcHttpRequest] -- HTTP RPC request handled: user=platform-user command=quorum is_external=false status=500 elapsed_time_ms=0 [httpworker.3] [httprpc.cpp:100] [~RpcHttpRequest] -- HTTP RPC request handled: user=platform-user command= is_external=false status=401 elapsed_time_ms=0 [httpworker.3] [httprpc.cpp:100] [~RpcHttpRequest] -- HTTP RPC request handled: user=platform-user command=getbestblockhash is_external=true status=200 elapsed_time_ms=28 [httpworker.0] [httprpc.cpp:100] [~RpcHttpRequest] -- HTTP RPC request handled: user=operator command=getbestblockhash is_external=false status=200 elapsed_time_ms=0 ``` ## Breaking Changes N/A It doesn't change behavior of rpc server and http server. ## Checklist: - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone ACKs for top commit: PastaPastaPasta: utACK 1a691bd Tree-SHA512: b62fceedb9a901e87c23c4aa6e6dfa7226d44da84a081ea245b40e7ff887103302147cebe0f7ff90bf9c8d4fa9ecafbaa6f25f39d2008f62c4f2beeef2877b57
- Loading branch information