# FUNCTION STATS

> Return the number of loaded function libraries and functions.

URL: https://docs.hotkv.com/commands/function-stats/

```
FUNCTION STATS
```

- Group: Scripting and functions
- Complexity: O(1)
- HotKV Cloud: all plans
- On-Premise: no license needed

`FUNCTION STATS` reports how many libraries and functions are loaded for each
engine. The only engine is `LUA`.

## Return value

| Case | RESP2 | RESP3 |
| --- | --- | --- |
| Always | Flat array of field, value pairs | Map |

The fields are `running_script`, which is always nil, and `engines`, holding
one entry for `LUA` with `libraries_count` and `functions_count`.

## Examples

```
127.0.0.1:6379> FUNCTION STATS
1) "running_script"
2) (nil)
3) "engines"
4) 1) "LUA"
   2) 1) "libraries_count"
      2) (integer) 1
      3) "functions_count"
      4) (integer) 1
```

## Compatibility

Same reply shape as Redis 7 and Valkey 8. Redis fills `running_script` with
details of the function running at the time; HotKV always reports nil there.

## See also

[FUNCTION LIST](https://docs.hotkv.com/commands/function-list/index.md), [FUNCTION KILL](https://docs.hotkv.com/commands/function-kill/index.md)