Skip to content

Commit cad2b53

Browse files
committed
Major update after API change
1 parent 5e56675 commit cad2b53

10 files changed

Lines changed: 340 additions & 172 deletions

File tree

content/commands/hotkeys-get.md

Lines changed: 94 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
---
2-
arguments:
3-
- name: mincpu
4-
optional: true
5-
token: MINCPU
6-
type: integer
7-
- name: minnet
8-
optional: true
9-
token: MINNET
10-
type: integer
11-
arity: -2
2+
acl_categories:
3+
- '@admin'
4+
- '@slow'
5+
- '@dangerous'
6+
arity: 2
127
categories:
138
- docs
149
- develop
@@ -20,12 +15,11 @@ categories:
2015
- kubernetes
2116
- clients
2217
command_flags:
23-
- ADMIN
24-
- NOSCRIPT
25-
complexity: O(K) where K is the number of hotkeys to return.
18+
- admin
19+
- noscript
20+
complexity: O(K) where K is the number of hotkeys returned.
2621
container: HOTKEYS
27-
description: Returns two lists of top K hotkeys - one by cpu time and one by network
28-
bytes.
22+
description: Returns lists of top K hotkeys depending on metrics chosen in HOTKEYS START command.
2923
function: hotkeysCommand
3024
group: server
3125
hidden: false
@@ -50,25 +44,59 @@ reply_schema:
5044
- description: If no tracking is started
5145
type: 'null'
5246
since: 8.6.0
53-
summary: Returns two lists of top K hotkeys - one by cpu time and one by network bytes.
54-
syntax_fmt: "HOTKEYS GET [MINCPU\_mincpu] [MINNET\_minnet]"
47+
summary: Returns lists of top K hotkeys depending on metrics chosen in HOTKEYS START command.
48+
syntax_fmt: HOTKEYS GET
5549
title: HOTKEYS GET
5650
---
57-
Returns two lists of top K hotkeys - one by cpu time and one by network bytes.
51+
Returns tracking results and metadata from the current or most recent hotkeys tracking session.
5852

59-
## Optional arguments
53+
This command returns comprehensive information about the hotkeys tracking session, including:
6054

61-
<details open><summary><code>MINCPU</code></summary>
55+
- Tracking metadata (start time, duration, sample ratio, etc.)
56+
- Performance statistics (CPU time, network bytes)
57+
- Lists of top K hotkeys sorted by the metrics specified in `HOTKEYS START`
6258

63-
Minimum CPU time percentage threshold. Only hotkeys with CPU time percentage greater than or equal to this value will be included in the `by-cpu-time` results.
59+
## Example
6460

65-
</details>
66-
67-
<details open><summary><code>MINNET</code></summary>
61+
```
62+
HOTKEYS GET
63+
1) "tracking-active"
64+
2) (integer) 0
65+
3) "sample-ratio"
66+
4) (integer) 1
67+
5) "selected-slots"
68+
6) (empty array)
69+
7) "all-commands-all-slots-ms"
70+
8) (integer) 0
71+
9) "net-bytes-all-commands-all-slots"
72+
10) (integer) 129
73+
11) "collection-start-time-unix-ms"
74+
12) (integer) 1768927872057
75+
13) "collection-duration-ms"
76+
14) (integer) 1
77+
15) "total-cpu-time-user-ms"
78+
16) (integer) 0
79+
17) "total-cpu-time-sys-ms"
80+
18) (integer) 0
81+
19) "total-net-bytes"
82+
20) (integer) 129
83+
21) "by-cpu-time"
84+
22) 1) "key1"
85+
2) (integer) 13
86+
3) "key2"
87+
4) (integer) 2
88+
23) "by-net-bytes"
89+
24) 1) "key1"
90+
2) (integer) 89
91+
3) "key2"
92+
4) (integer) 40
93+
```
6894

69-
Minimum network bytes percentage threshold. Only hotkeys with network bytes percentage greater than or equal to this value will be included in the `by-net-bytes` results.
95+
## Redis Enterprise and Redis Cloud compatibility
7096

71-
</details>
97+
| Redis<br />Enterprise | Redis<br />Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> |
98+
|:----------------------|:-----------------|:------|
99+
| <span title="Not supported">&#x274c; Standard</span><br /><span title="Not supported"><nobr>&#x274c; Active-Active</nobr></span> | <span title="Not supported">&#x274c; Standard</span><br /><span title="Not supported"><nobr>&#x274c; Active-Active</nobr></span> | |
72100

73101
## Return information
74102

@@ -77,74 +105,51 @@ Minimum network bytes percentage threshold. Only hotkeys with network bytes perc
77105
tab2="RESP3" >}}
78106

79107
One of the following:
80-
- [Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}}) with the following items when tracking data is available:
81-
- `collection-start-time`: Unix timestamp (integer) when tracking started.
82-
- `collection-duration`: Duration in seconds (integer) of the tracking period.
83-
- `by-cpu-time`: Array of key-percentage pairs (bulk strings) sorted by CPU time usage.
84-
- `by-net-bytes`: Array of key-percentage pairs (bulk strings) sorted by network bytes usage.
85108

86-
- [Null bulk string reply]({{< relref "/develop/reference/protocol-spec#bulk-strings" >}}) when no tracking has been started or no data is available.
87-
88-
Example with tracking data:
89-
```
90-
*8
91-
$21
92-
collection-start-time
93-
:1768232225
94-
$19
95-
collection-duration
96-
:0
97-
$11
98-
by-cpu-time
99-
*2
100-
$6
101-
keys_1
102-
$6
103-
100.00
104-
$12
105-
by-net-bytes
106-
*2
107-
$6
108-
keys_1
109-
$6
110-
100.00
111-
```
109+
**[Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}})** when tracking data is available, containing pairs of field names and values:
110+
111+
- `tracking-active` (integer): 1 if tracking is active, 0 if stopped
112+
- `sample-ratio` (integer): The sampling ratio used during tracking
113+
- `selected-slots` (array): Array of slot numbers being tracked (empty if all slots)
114+
- `sampled-command-selected-slots-ms` (integer): Time in milliseconds for sampled commands on selected slots (conditional)
115+
- `all-commands-selected-slots-ms` (integer): Time in milliseconds for all commands on selected slots (conditional)
116+
- `all-commands-all-slots-ms` (integer): Time in milliseconds for all commands on all slots
117+
- `net-bytes-sampled-commands-selected-slots` (integer): Network bytes for sampled commands on selected slots (conditional)
118+
- `net-bytes-all-commands-selected-slots` (integer): Network bytes for all commands on selected slots (conditional)
119+
- `net-bytes-all-commands-all-slots` (integer): Network bytes for all commands on all slots
120+
- `collection-start-time-unix-ms` (integer): Unix timestamp in milliseconds when tracking started
121+
- `collection-duration-ms` (integer): Duration of tracking in milliseconds
122+
- `used-cpu-sys-ms` (integer): System CPU time used in milliseconds
123+
- `used-cpu-user-ms` (integer): User CPU time used in milliseconds
124+
- `total-net-bytes` (integer): Total network bytes processed
125+
- `by-cpu-time` (array): Array of key-time pairs sorted by CPU time (if CPU tracking enabled)
126+
- `by-net-bytes` (array): Array of key-bytes pairs sorted by network bytes (if NET tracking enabled)
127+
128+
**[Null reply]({{< relref "/develop/reference/protocol-spec#bulk-strings" >}})** when no tracking has been started or data has been reset.
112129

113130
-tab-sep-
114131

115132
One of the following:
116-
- [Map reply]({{< relref "/develop/reference/protocol-spec#maps" >}}) with the following items when tracking data is available:
117133

118-
- `collection-start-time`: Unix timestamp (integer) when tracking started.
119-
- `collection-duration`: Duration in seconds (integer) of the tracking period.
120-
- `by-cpu-time`: Array of key-percentage (bulk string) pairs sorted by CPU time usage.
121-
- `by-net-bytes`: Array of key-percentage (bulk string) pairs sorted by network bytes usage.
122-
- [Null reply]({{< relref "/develop/reference/protocol-spec#nulls" >}}) when no tracking has been started or no data is available.
123-
124-
Example with tracking data:
125-
```
126-
%4
127-
$21
128-
collection-start-time
129-
:1768232225
130-
$19
131-
collection-duration
132-
:0
133-
$11
134-
by-cpu-time
135-
*2
136-
$6
137-
keys_1
138-
$6
139-
100.00
140-
$12
141-
by-net-bytes
142-
*2
143-
$6
144-
keys_1
145-
$6
146-
100.00
147-
```
134+
**[Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}})** when tracking data is available, containing pairs of field names and values:
135+
136+
- `tracking-active` (integer): 1 if tracking is active, 0 if stopped
137+
- `sample-ratio` (integer): The sampling ratio used during tracking
138+
- `selected-slots` (array): Array of slot numbers being tracked (empty if all slots)
139+
- `sampled-command-selected-slots-ms` (integer): Time in milliseconds for sampled commands on selected slots (conditional)
140+
- `all-commands-selected-slots-ms` (integer): Time in milliseconds for all commands on selected slots (conditional)
141+
- `all-commands-all-slots-ms` (integer): Time in milliseconds for all commands on all slots
142+
- `net-bytes-sampled-commands-selected-slots` (integer): Network bytes for sampled commands on selected slots (conditional)
143+
- `net-bytes-all-commands-selected-slots` (integer): Network bytes for all commands on selected slots (conditional)
144+
- `net-bytes-all-commands-all-slots` (integer): Network bytes for all commands on all slots
145+
- `collection-start-time-unix-ms` (integer): Unix timestamp in milliseconds when tracking started
146+
- `collection-duration-ms` (integer): Duration of tracking in milliseconds
147+
- `used-cpu-sys-ms` (integer): System CPU time used in milliseconds
148+
- `used-cpu-user-ms` (integer): User CPU time used in milliseconds
149+
- `total-net-bytes` (integer): Total network bytes processed
150+
- `by-cpu-time` (array): Array of key-time pairs sorted by CPU time (if CPU tracking enabled)
151+
- `by-net-bytes` (array): Array of key-bytes pairs sorted by network bytes (if NET tracking enabled)
152+
153+
**[Null reply]({{< relref "/develop/reference/protocol-spec#bulk-strings" >}})** when no tracking has been started or data has been reset.
148154

149155
{{< /multitabs >}}
150-

content/commands/hotkeys-reset.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
acl_categories:
3+
- '@admin'
4+
- '@slow'
5+
- '@dangerous'
6+
arity: 2
7+
categories:
8+
- docs
9+
- develop
10+
- stack
11+
- oss
12+
- rs
13+
- rc
14+
- oss
15+
- kubernetes
16+
- clients
17+
command_flags:
18+
- admin
19+
- noscript
20+
complexity: O(1)
21+
container: HOTKEYS
22+
description: Release the resources used for hotkey tracking.
23+
function: hotkeysCommand
24+
group: server
25+
hidden: false
26+
linkTitle: HOTKEYS RESET
27+
railroad_diagram: /images/railroad/hotkeys-reset.svg
28+
since: 8.6.0
29+
summary: Release the resources used for hotkey tracking.
30+
syntax_fmt: HOTKEYS RESET
31+
title: HOTKEYS RESET
32+
---
33+
Release the resources used for hotkey tracking.
34+
35+
This command can only be executed when hotkey tracking is stopped. It will return an error if tracking is currently active. Use [`HOTKEYS STOP`]({{< relref "/commands/hotkeys-stop" >}}) first to stop tracking, then use `HOTKEYS RESET` to free the allocated resources.
36+
37+
## Redis Enterprise and Redis Cloud compatibility
38+
39+
| Redis<br />Enterprise | Redis<br />Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> |
40+
|:----------------------|:-----------------|:------|
41+
| <span title="Not supported">&#x274c; Standard</span><br /><span title="Not supported"><nobr>&#x274c; Active-Active</nobr></span> | <span title="Not supported">&#x274c; Standard</span><br /><span title="Not supported"><nobr>&#x274c; Active-Active</nobr></span> | |
42+
43+
## Return information
44+
45+
{{< multitabs id="return-info"
46+
tab1="RESP2"
47+
tab2="RESP3" >}}
48+
49+
One of the following:
50+
51+
- [Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}): `OK` when resources are successfully released.
52+
- [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}): when tracking is currently active.
53+
54+
-tab-sep-
55+
56+
One of the following:
57+
58+
- [Simple string reply]({{< relref "/develop/reference/protocol-spec#simple-strings" >}}): `OK` when resources are successfully released.
59+
- [Simple error reply]({{< relref "/develop/reference/protocol-spec#simple-errors" >}}): when tracking is currently active.
60+
61+
{{< /multitabs >}}

0 commit comments

Comments
 (0)