What's new in Valkey 9.0? Discover new features and improvements. Read the announcement.

SLOWLOG LEN

Returns the number of entries in the slow log.

Usage
SLOWLOG LEN
Complexity
O(1)
Since
2.2.12
ACL Categories
@admin, @dangerous, @slow
Command flags
ADMIN, LOADING, STALE

This command returns the current number of entries in the slow log.

A new entry is added to the slow log whenever a command exceeds the execution time threshold defined by the slowlog-log-slower-than configuration directive. The maximum number of entries in the slow log is governed by the slowlog-max-len configuration directive. Once the slog log reaches its maximal size, the oldest entry is removed whenever a new entry is created. The slow log can be cleared with the SLOWLOG RESET command.

Alternative

COMMANDLOG LEN SLOW

Replies

RESP2

Integer reply: the number of entries in the slow log.

RESP3

Integer reply: the number of entries in the slow log.