> For the complete documentation index, see [llms.txt](https://docs.rainmad.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rainmad.com/resources/watch-admin-menu/features/dashboard-and-server-metrics.md).

# Dashboard and server metrics

How the server is doing, in the menu's **Dashboard** and on the web panel's **Dashboard**, with history graphs on the web. The owner can also profile resources, restart the server with a countdown, and use the console from the web.

## Setup

Two ace lines switch on the parts that run console commands. Without them those buttons say what is missing and do nothing:

```cfg
add_ace resource.rm_watch command.profiler allow   # Run profile
add_ace resource.rm_watch command.quit allow       # Restart server
```

## What the numbers mean

| Tile                       | Meaning                                                                                    |
| -------------------------- | ------------------------------------------------------------------------------------------ |
| Server FPS, frame time     | FXServer runs 20 frames a second, so a healthy server shows about 20 FPS and 50 ms frames. |
| Hitches                    | Frames of `cfg.perf.hitchMs` (150 ms) or longer, plus FXServer's own hitch warnings.       |
| CPU                        | The FXServer process, as a share of the machine and of one core.                           |
| RAM                        | Memory the FXServer process holds, and the machine's total and free memory.                |
| Uptime                     | How long the FXServer process has run.                                                     |
| Ping                       | Average and highest ping of the players online.                                            |
| Staff online, open reports | Players with a staff role, and tickets nobody closed yet.                                  |

A sample is taken every 10 seconds. The web panel keeps one per minute for two days and one per hour for 90 days, so the graphs cover the last hour, 24 hours, 7 days and 30 days. Time the server was off is drawn as a gap, never as zero.

The menu's Dashboard also shows the players online, a population graph, top actions and the latest staff actions. Other scripts can add their own numbers, see [Exports and events](https://docs.rainmad.com/resources/watch-admin-menu/reference/exports-and-events#dashboard-numbers).

## Heat map

An anonymous picture of where the server is busy, drawn over the map. Every `sampleSeconds` each online player's map cell is counted. No name, no path and no per player row is ever stored, only a total per cell.

```lua
cfg.heatmap = { enabled = true, cellMeters = 50, sampleSeconds = 120, keepDays = 30 }
```

## Resources and profiling

The web panel's **Resources** page lists every resource with its state. **Run profile** records 5, 10 or 30 seconds of server frames and shows, per resource, the script time per frame, its worst frame and its share of all script time.

Memory per resource is not shown: FXServer cannot report another resource's memory on the server side (`resmon` is a client tool). The page says so.

## Restarting the server

Pick a countdown (`cfg.perf.restart.countdowns`) and an optional reason. Players are warned in game at each mark in `warnAt`. When it ends:

1. rm\_watch sends txAdmin's own `scheduledRestart` and `serverShuttingDown` events, which frameworks and inventories already save on (`txAdminEvents = false` turns this off).
2. It waits `saveSeconds`, drops every player with the restart message, and runs `quit`.
3. **With txAdmin**, txAdmin starts the server again. **Without txAdmin**, the server only comes back if a process manager (systemd, pm2, a loop script) restarts it. The dashboard says which case your server is in.

A restart can be cancelled until it reaches zero, and players are told.

```lua
cfg.perf = {
    hitchMs = 150,
    profileFrames = 200,
    restart = {
        countdowns = { 60, 300, 600, 900, 1800 },             -- seconds
        default = 300,
        warnAt = { 1800, 900, 600, 300, 120, 60, 30, 10, 5 }, -- seconds before the restart
        saveSeconds = 5,
        txAdminEvents = true,
    },
}
```

## The console on the web

The web panel's **Console** page shows the server console as it prints (the last 500 lines and everything after). Reading it needs `perf:log` (admin by default).

Typing commands and starting or stopping resources from the web is **off** until you add:

```cfg
set rm_watch_web_console true
```

It is read on every call, so no restart is needed. Even then only the **owner** role can use it, and every command is written to the staff log. A command runs as the rm\_watch resource, so restricted ones also need `add_ace resource.rm_watch command allow` (or one `command.<name>` line).

## Permissions

In the **Server metrics** category:

| Action                                                                 | Default                                 |
| ---------------------------------------------------------------------- | --------------------------------------- |
| `perf:now`, `perf:resources`, `profile:result`                         | moderator                               |
| `perf:log`                                                             | admin                                   |
| `profile:run`, `server:restart`, `server:restart:cancel`               | owner                                   |
| `console:read`, `console:exec`, `resources`, `resource` (from the web) | owner, and only with the web console on |

{% hint style="info" %}
**RedM:** the ace lines name `resource.rm_watch_redm` instead. Everything else is the same.
{% endhint %}
