FUNCTION STATS · Valkey

FUNCTION STATS

Returns information about a function during execution.

Usage

FUNCTION STATS

Description

Return information about the function that’s currently running and information about the available execution engines.

The reply is map with two keys:

  1. running_script: information about the running script. If there’s no in-flight function, the server replies with a nil. Otherwise, this is a map with the following keys:
  1. engines: this is a map of maps. Each entry in the map represent a single engine. Engine map contains statistics about the engine like number of functions and number of libraries.

You can use this command to inspect the invocation of a long-running function and decide whether kill it with the FUNCTION KILL command.

For more information please refer to Introduction to Valkey Functions.

Reply RESP2

Array reply: information about the function that’s currently running and information about the available execution engines.

Reply RESP3

Map reply: information about the function that’s currently running and information about the available execution engines.

Complexity

O(1)

ACL Categories

@scripting

History

See also

EVAL, EVALSHA, EVALSHA_RO, EVAL_RO, FCALL, FCALL_RO, FUNCTION, FUNCTION DELETE, FUNCTION DUMP, FUNCTION FLUSH, FUNCTION HELP, FUNCTION KILL, FUNCTION LIST, FUNCTION LOAD, FUNCTION RESTORE, SCRIPT, SCRIPT DEBUG, SCRIPT EXISTS, SCRIPT FLUSH, SCRIPT HELP, SCRIPT KILL, SCRIPT LOAD.