Repository navigation
Commit 6cc736f
Fix the Redis instance average command time showing 0 or 1
meter_redis_instance_average_time_spent_by_command divided the lifetime
counters redis_commands_duration_seconds_total and redis_commands_total
and then took rate('PT1M') of the ratio. That is how fast the lifetime
average drifts, not the average time of a command.
Divide the rate of the command time by the rate of the command count,
with safeDiv for commands idle in the window, and report the average in
microseconds. A meter value is stored as a whole number, and any value
between 0 and 1 is stored as 1, so an average in seconds, far below 1
for Redis, would show 1 for every command that ran.
The MAL script test input now spends 200 microseconds per command, so
the test pins the scale. The Redis monitoring doc gives the unit as
microseconds and names the instance metric.1 parent 0a862ab commit 6cc736f
4 files changed
Lines changed: 6 additions & 5 deletions
File tree
- docs/en
- changes
- setup/backend
- oap-server
- analyzer/meter-analyzer-scripts-test/src/test/resources/scripts/mal/test-otel-rules/redis
- server-starter/src/main/resources/otel-rules/redis
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| 92 | + | |
92 | 93 | | |
93 | 94 | | |
94 | 95 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| |||
198 | 198 | | |
199 | 199 | | |
200 | 200 | | |
201 | | - | |
| 201 | + | |
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
213 | | - | |
| 213 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
0 commit comments