-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Valkey PR link; valkey-io/valkey#351. Signed-off-by: Kyle Kim <[email protected]>
- Loading branch information
1 parent
c8644e8
commit 8ec5cbc
Showing
3 changed files
with
123 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
`CLUSTER SLOT-STATS` returns an array of slot usage statistics for slots assigned to the current shard. | ||
The command is suitable for Valkey Cluster users aiming to assess general slot usage trends, identify hot / cold slots, migrate slots for a balanced cluster workload, and / or re-write application logic to better utilize slots. | ||
|
||
As of now, the following metrics are supported: | ||
* key-count | ||
|
||
## Supported arguments | ||
There exist two mutually exclusive arguments, namely; | ||
|
||
### SLOTSRANGE | ||
Returns slot statistics based on the slots range provided. | ||
The `SLOTSRANGE` argument allows for request pagination. | ||
|
||
``` | ||
> CLUSTER SLOT-STATS SLOTSRANGE 0 2 | ||
> 1) (integer) 0 | ||
> 2) 1) "key-count" | ||
> 2) (integer) 0 | ||
> 3) (integer) 1 | ||
> 4) 1) "key-count" | ||
> 2) (integer) 0 | ||
> 5) (integer) 2 | ||
> 6) 1) "key-count" | ||
> 2) (integer) 0 | ||
``` | ||
|
||
### ORDERBY | ||
Orders slot statistics based on the provided metric. Right now, only `key-count` is available. | ||
The `ORDERBY` argument allows for the user to identify hot / cold slots across the cluster. | ||
|
||
``` | ||
> CLUSTER SLOT-STATS ORDERBY KEY-COUNT LIMIT 3 DESC | ||
> 1) (integer) 12426 | ||
> 2) 1) "key-count" | ||
> 2) (integer) 45 | ||
> 3) (integer) 13902 | ||
> 4) 1) "key-count" | ||
> 2) (integer) 20 | ||
> 5) (integer) 2704 | ||
> 6) 1) "key-count" | ||
> 2) (integer) 11 | ||
``` |
Binary file not shown.