# TENANT.STATS

> Show a tenant's usage figures alongside its memory and key quota values.

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

```
TENANT.STATS id
```

- Group: Tenancy
- Complexity: O(1)
- HotKV Cloud: Scale plan
- On-Premise: requires the multi-tenancy license feature

`TENANT.STATS` returns the usage figures this node keeps for a tenant,
together with the memory and key quota values set with
[TENANT.CREATE](https://docs.hotkv.com/commands/tenant-create/index.md). Usage figures are per node.
The quota values are informational: HotKV does not enforce them on client
commands. The usage figures are not updated by client traffic, so they
read 0.

## Return value

Nil (RESP2) or null (RESP3) when the tenant does not exist. Otherwise a flat
array of field and value pairs, in RESP2 and RESP3, all values integers:

| Field | Meaning |
| --- | --- |
| `memory_bytes` | Memory usage figure |
| `memory_limit` | The `MAX_MEMORY` value (0 for unlimited) |
| `key_count` | Key usage figure |
| `key_limit` | The `MAX_KEYS` value (0 for unlimited) |
| `active_connections` | Connection usage figure |
| `total_commands` | Command count |
| `total_bytes_in` | Incoming bytes |
| `total_bytes_out` | Outgoing bytes |
| `total_errors` | Error count |

Without a license that includes `multi-tenancy`, the reply is
`NOLICENSE multi-tenancy requires a HotKV license. Contact sales@hotkv.com`.

## Examples

```
127.0.0.1:6379> TENANT.STATS acme
 1) "memory_bytes"
 2) (integer) 0
 3) "memory_limit"
 4) (integer) 1073741824
 5) "key_count"
 6) (integer) 0
 7) "key_limit"
 8) (integer) 1000000
 9) "active_connections"
10) (integer) 0
11) "total_commands"
12) (integer) 0
13) "total_bytes_in"
14) (integer) 0
15) "total_bytes_out"
16) (integer) 0
17) "total_errors"
18) (integer) 0
```

## Compatibility

HotKV-only command.

## See also

[TENANT.INFO](https://docs.hotkv.com/commands/tenant-info/index.md), [TENANT.CREATE](https://docs.hotkv.com/commands/tenant-create/index.md)