[GH-ISSUE #4631] [Engine] Monitor: Clear hides only the request rows; the totals can only be reset by restarting the server #2100

Open
opened 2026-11-04 01:56:40 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @Efs-O on GitHub (Oct 29, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4631

Area

[Engine] (speed, kernels, models, the server and API)

What do you want to do?

Reset the Monitor's totals line ("Since …: N requests · … prompt tokens read · … written") without restarting the server.

Today:

  • The totals live in memory from the moment the server process starts (self.totals, serve/server.py:3892-3893).
  • POST /unload and the next load keep the same process, so the totals span every model load. After a few model switches they mix several models' speeds and counts, and they no longer describe the model that is loaded now.
  • The Clear button on "Recent requests" (serve/web/app.js:1015-1020) only hides the request rows in the browser (reqClearedAfter). The totals line and the server-side counters are untouched, so clearing leaves the totals showing the old numbers. That surprised me: I expected Clear to start the whole Monitor fresh.

Two possible shapes, either would do:

  1. Clear resets the totals too. For example, a POST /metrics/reset (behind the API key when one is set) that zeroes self.totals and sets since to now, called by the Clear button.
  2. Totals per load. Zero the totals when a model loads, or show "since this load" next to "since server start".

/metrics/prometheus counters should probably stay monotonic since process start, so a reset would apply to the Monitor's totals only.

What do you do today instead?

Stop the Strata server process and start it again. That is the only way to zero the totals, and it costs a full model reload.

Originally created by @Efs-O on GitHub (Oct 29, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/4631 ### Area [Engine] (speed, kernels, models, the server and API) ### What do you want to do? Reset the Monitor's totals line ("Since …: N requests · … prompt tokens read · … written") without restarting the server. Today: - The totals live in memory from the moment the server process starts (`self.totals`, `serve/server.py:3892-3893`). - `POST /unload` and the next load keep the same process, so the totals span every model load. After a few model switches they mix several models' speeds and counts, and they no longer describe the model that is loaded now. - The **Clear** button on "Recent requests" (`serve/web/app.js:1015-1020`) only hides the request rows in the browser (`reqClearedAfter`). The totals line and the server-side counters are untouched, so clearing leaves the totals showing the old numbers. That surprised me: I expected Clear to start the whole Monitor fresh. Two possible shapes, either would do: 1. **Clear resets the totals too.** For example, a `POST /metrics/reset` (behind the API key when one is set) that zeroes `self.totals` and sets `since` to now, called by the Clear button. 2. **Totals per load.** Zero the totals when a model loads, or show "since this load" next to "since server start". `/metrics/prometheus` counters should probably stay monotonic since process start, so a reset would apply to the Monitor's totals only. ### What do you do today instead? Stop the Strata server process and start it again. That is the only way to zero the totals, and it costs a full model reload.
Author
Owner

@au70ma70n commented on GitHub (Oct 30, 2026):

The costing branch work now has four pull requests: the counts are kept between starts, then priced at the owner's own numbers, then split into a cache write and a cache read, and the settings-card layout fix that made the price fields usable. --totals-reset is a flag for now, not the button this issue asks for - keeping the counts and clearing them are opposite ends of the same file, so which way the counters should move when a window closes is still the maintainer's call. Scope thread: #4742.

<!-- gh-comment-id:6533553580 --> @au70ma70n commented on GitHub (Oct 30, 2026): The costing branch work now has four pull requests: the counts are kept between starts, then priced at the owner's own numbers, then split into a cache write and a cache read, and the settings-card layout fix that made the price fields usable. `--totals-reset` is a flag for now, not the button this issue asks for - keeping the counts and clearing them are opposite ends of the same file, so which way the counters should move when a window closes is still the maintainer's call. Scope thread: #4742.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#2100
No description provided.