Input output traffic stats and command process count for each client.
We already have global stats for input traffic, output traffic and how many commands have been executed.
However, some users have the difficulty of locating the IP(s) which have heavy network traffic. So here some stats for single client are introduced.
tot-net-in // Total network input bytes read from the client
tot-net-out // Total network output bytes sent to the client
tot-cmds // Total commands the client has executed
These three stats are shown in CLIENT LIST and CLIENT INFO.
Though the metrics are handled in hot paths of the code, personally I don't think it will slow down the server. Considering all other complex operations handled nearby, this is only a small and simple operation.
However we do need to be cautious when adding more and more metrics, as discussed in redis/redis#12640, we may need to find a way to tell whether this has obvious performance degradation.
@valkey-io/core-team Please 👍 and 👎 for this since it's a major issue.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
:exclamation: No coverage uploaded for pull request base (
unstable@96d14fe). Click here to learn what that means.
Additional details and impacted files
@@ Coverage Diff @@
## unstable #327 +/- ##
===========================================
Coverage ? 68.40%
===========================================
Files ? 108
Lines ? 61571
Branches ? 0
===========================================
Hits ? 42118
Misses ? 19453
Partials ? 0
| Files | Coverage Δ | |
|---|---|---|
| src/blocked.c | 91.86% <100.00%> (ø) |
|
| src/networking.c | 84.94% <100.00%> (ø) |
|
| src/server.c | 88.13% <100.00%> (ø) |
OK, besides the one comment about tot-cmds, the change LGTM.
@madolson Any more comments? I think this PR is ready to merge.