|
| 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(K) where K is the number of hotkeys returned. |
| 21 | +container: HOTKEYS |
| 22 | +description: Returns lists of top K hotkeys depending on metrics chosen in HOTKEYS START command. |
| 23 | +function: hotkeysCommand |
| 24 | +group: server |
| 25 | +hidden: false |
| 26 | +linkTitle: HOTKEYS GET |
| 27 | +railroad_diagram: /images/railroad/hotkeys-get.svg |
| 28 | +reply_schema: |
| 29 | + oneOf: |
| 30 | + - additionalProperties: false |
| 31 | + description: Hotkeys report with collection metadata and two sorted lists |
| 32 | + properties: |
| 33 | + by-cpu-time: |
| 34 | + description: Array of hotkeys with CPU time percentages |
| 35 | + type: array |
| 36 | + by-net-bytes: |
| 37 | + description: Array of hotkeys with network throughput percentages |
| 38 | + type: array |
| 39 | + collection-duration: |
| 40 | + type: integer |
| 41 | + collection-start-time: |
| 42 | + type: integer |
| 43 | + type: object |
| 44 | + - description: If no tracking is started |
| 45 | + type: 'null' |
| 46 | +since: 8.6.0 |
| 47 | +summary: Returns lists of top K hotkeys depending on metrics chosen in HOTKEYS START command. |
| 48 | +syntax_fmt: HOTKEYS GET |
| 49 | +title: HOTKEYS GET |
| 50 | +--- |
| 51 | +Returns tracking results and metadata from the current or most recent hotkeys tracking session. |
| 52 | + |
| 53 | +This command returns comprehensive information about the hotkeys tracking session, including: |
| 54 | + |
| 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` |
| 58 | + |
| 59 | +## Example |
| 60 | + |
| 61 | +``` |
| 62 | +HOTKEYS GET |
| 63 | + 1) "tracking-active" |
| 64 | + 2) (integer) 1 |
| 65 | + 3) "sample-ratio" |
| 66 | + 4) (integer) 1 |
| 67 | + 5) "selected-slots" |
| 68 | + 6) (empty array) |
| 69 | + 7) "all-commands-all-slots-us" |
| 70 | + 8) (integer) 220 |
| 71 | + 9) "net-bytes-all-commands-all-slots" |
| 72 | +10) (integer) 200 |
| 73 | +11) "collection-start-time-unix-ms" |
| 74 | +12) (integer) 1769420604522 |
| 75 | +13) "collection-duration-ms" |
| 76 | +14) (integer) 6408 |
| 77 | +15) "total-cpu-time-user-ms" |
| 78 | +16) (integer) 3 |
| 79 | +17) "total-cpu-time-sys-ms" |
| 80 | +18) (integer) 11 |
| 81 | +19) "by-cpu-time-us" |
| 82 | +20) 1) "x" |
| 83 | + 2) (integer) 104 |
| 84 | + 3) "y" |
| 85 | + 4) (integer) 98 |
| 86 | + 5) "z" |
| 87 | + 6) (integer) 18 |
| 88 | +``` |
| 89 | + |
| 90 | +## Redis Enterprise and Redis Cloud compatibility |
| 91 | + |
| 92 | +| Redis<br />Enterprise | Redis<br />Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> | |
| 93 | +|:----------------------|:-----------------|:------| |
| 94 | +| <span title="Not supported">❌ Standard</span><br /><span title="Not supported"><nobr>❌ Active-Active</nobr></span> | <span title="Not supported">❌ Standard</span><br /><span title="Not supported"><nobr>❌ Active-Active</nobr></span> | | |
| 95 | + |
| 96 | +## Return information |
| 97 | + |
| 98 | +{{< multitabs id="return-info" |
| 99 | + tab1="RESP2" |
| 100 | + tab2="RESP3" >}} |
| 101 | + |
| 102 | +One of the following: |
| 103 | + |
| 104 | +**[Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}})** when tracking data is available, containing pairs of field names and values: |
| 105 | + |
| 106 | +- `tracking-active` (integer): 1 if tracking is active, 0 if stopped |
| 107 | +- `sample-ratio` (integer): The sampling ratio used during tracking |
| 108 | +- `selected-slots` (array): Array of slot numbers being tracked (empty if all slots) |
| 109 | +- `sampled-command-selected-slots-us` (integer): Time in microseconds for sampled commands on selected slots (conditional) |
| 110 | +- `all-commands-selected-slots-us` (integer): Time in microseconds for all commands on selected slots (conditional) |
| 111 | +- `all-commands-all-slots-us` (integer): Time in microseconds for all commands on all slots |
| 112 | +- `net-bytes-sampled-commands-selected-slots` (integer): Network bytes for sampled commands on selected slots (conditional) |
| 113 | +- `net-bytes-all-commands-selected-slots` (integer): Network bytes for all commands on selected slots (conditional) |
| 114 | +- `net-bytes-all-commands-all-slots` (integer): Network bytes for all commands on all slots |
| 115 | +- `collection-start-time-unix-ms` (integer): Unix timestamp in milliseconds when tracking started |
| 116 | +- `collection-duration-ms` (integer): Duration of tracking in milliseconds |
| 117 | +- `used-cpu-sys-ms` (integer): System CPU time used in milliseconds |
| 118 | +- `used-cpu-user-ms` (integer): User CPU time used in milliseconds |
| 119 | +- `total-net-bytes` (integer): Total network bytes processed |
| 120 | +- `by-cpu-time-us` (array): Array of key-time pairs sorted by CPU time in microseconds (if CPU tracking enabled) |
| 121 | +- `by-net-bytes` (array): Array of key-bytes pairs sorted by network bytes (if NET tracking enabled) |
| 122 | + |
| 123 | +**[Null reply]({{< relref "/develop/reference/protocol-spec#bulk-strings" >}})** when no tracking has been started or data has been reset. |
| 124 | + |
| 125 | +-tab-sep- |
| 126 | + |
| 127 | +One of the following: |
| 128 | + |
| 129 | +**[Array reply]({{< relref "/develop/reference/protocol-spec#arrays" >}})** when tracking data is available, containing pairs of field names and values: |
| 130 | + |
| 131 | +- `tracking-active` (integer): 1 if tracking is active, 0 if stopped |
| 132 | +- `sample-ratio` (integer): The sampling ratio used during tracking |
| 133 | +- `selected-slots` (array): Array of slot numbers being tracked (empty if all slots) |
| 134 | +- `sampled-command-selected-slots-us` (integer): Time in microseconds for sampled commands on selected slots (conditional) |
| 135 | +- `all-commands-selected-slots-us` (integer): Time in microseconds for all commands on selected slots (conditional) |
| 136 | +- `all-commands-all-slots-us` (integer): Time in microseconds for all commands on all slots |
| 137 | +- `net-bytes-sampled-commands-selected-slots` (integer): Network bytes for sampled commands on selected slots (conditional) |
| 138 | +- `net-bytes-all-commands-selected-slots` (integer): Network bytes for all commands on selected slots (conditional) |
| 139 | +- `net-bytes-all-commands-all-slots` (integer): Network bytes for all commands on all slots |
| 140 | +- `collection-start-time-unix-ms` (integer): Unix timestamp in milliseconds when tracking started |
| 141 | +- `collection-duration-ms` (integer): Duration of tracking in milliseconds |
| 142 | +- `used-cpu-sys-ms` (integer): System CPU time used in milliseconds |
| 143 | +- `used-cpu-user-ms` (integer): User CPU time used in milliseconds |
| 144 | +- `total-net-bytes` (integer): Total network bytes processed |
| 145 | +- `by-cpu-time-us` (array): Array of key-time pairs sorted by CPU time in microseconds (if CPU tracking enabled) |
| 146 | +- `by-net-bytes` (array): Array of key-bytes pairs sorted by network bytes (if NET tracking enabled) |
| 147 | + |
| 148 | +**[Null reply]({{< relref "/develop/reference/protocol-spec#bulk-strings" >}})** when no tracking has been started or data has been reset. |
| 149 | + |
| 150 | +{{< /multitabs >}} |
0 commit comments