[GH-ISSUE #3053] serve: lifetime token totals + a Codex-style daily activity heatmap in the monitor #1224

Closed
opened 2026-11-04 01:49:29 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @wangzc1997 on GitHub (Oct 18, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/3053

The monitor is genuinely lovely. Two small additions around it would let it answer the question I keep getting asked: "how much have I been using this machine?" They share one mechanism — persistent per-day counters — so filing them together.

1. Lifetime token totals (across restarts)

The monitor already shows a per-session line under the request list ("Since : N requests · X prompt tokens read (Y reused) · Z written"), and /metrics totals matches it — but both restart from zero every time serve starts. For a machine that runs Strata 24/7 across many restarts, the number I actually want is the lifetime total: how many tokens this install has served so far.

Suggestion:

  • Persist counters in a small JSON in the instance's state directory (prompt_tokens, output_tokens, reused_tokens, requests, plus per-day buckets), merged at startup.
  • Expose as totals_lifetime in /metrics next to the existing session totals; current fields unchanged.
  • Show a "Total since install" line in the monitor.

The increment site already exists where totals is maintained; the new work is mainly flushing the counters on shutdown / SIGTERM (including Windows terminate).

2. A Codex-style daily activity heatmap

The Codex CLI shows a token activity grid: one square per day, weeks as columns, shaded by that day's token count, with 每天 / 每周 / 累计总量 (daily / weekly / cumulative) toggles. It makes usage patterns obvious at a glance, and with the per-day buckets from (1) the data is already there.

codex-style activity grid for reference

Context

Until now I reconstruct both by parsing "[strata] done: N tokens" and "prompt N tokens = ..." log lines — workable, but older logs omit the prompt field for small prompts, so those can only be estimated. A first-class counter would be far more reliable, and the heatmap would make the monitor even better than it already is.

Environment: v0.1.44.1, Windows 11.

Originally created by @wangzc1997 on GitHub (Oct 18, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/3053 The monitor is genuinely lovely. Two small additions around it would let it answer the question I keep getting asked: "how much have I been using this machine?" They share one mechanism — persistent per-day counters — so filing them together. **1. Lifetime token totals (across restarts)** The monitor already shows a per-session line under the request list ("Since <boot>: N requests · X prompt tokens read (Y reused) · Z written"), and `/metrics` `totals` matches it — but both restart from zero every time `serve` starts. For a machine that runs Strata 24/7 across many restarts, the number I actually want is the lifetime total: how many tokens this install has served so far. Suggestion: - Persist counters in a small JSON in the instance's state directory (prompt_tokens, output_tokens, reused_tokens, requests, plus per-day buckets), merged at startup. - Expose as `totals_lifetime` in `/metrics` next to the existing session totals; current fields unchanged. - Show a "Total since install" line in the monitor. The increment site already exists where `totals` is maintained; the new work is mainly flushing the counters on shutdown / SIGTERM (including Windows terminate). **2. A Codex-style daily activity heatmap** The Codex CLI shows a token activity grid: one square per day, weeks as columns, shaded by that day's token count, with 每天 / 每周 / 累计总量 (daily / weekly / cumulative) toggles. It makes usage patterns obvious at a glance, and with the per-day buckets from (1) the data is already there. ![codex-style activity grid for reference](C:/Users/admin/AppData/Local/hermes/cache/images/img_17457ea30be4.png) **Context** Until now I reconstruct both by parsing "[strata] done: N tokens" and "prompt N tokens = ..." log lines — workable, but older logs omit the prompt field for small prompts, so those can only be estimated. A first-class counter would be far more reliable, and the heatmap would make the monitor even better than it already is. Environment: v0.1.44.1, Windows 11.
Author
Owner

@Niko1221 commented on GitHub (Oct 19, 2026):

Thanks for taking the time to report this.

We're resetting the tracker for 0.2.0-beta. There are more than 1,300 open issues and pull requests, too many for us to read properly, so we're closing everything that isn't being worked on right now. Closed here does not mean rejected.

To reopen it takes about two minutes:

  1. Re-test on 0.2.0-beta. It may already be fixed. Write down what you see.
  2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other].
  3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system.
  4. Comment /reopen. A check runs and either reopens the issue or lists what is still missing.

The rules are in CONTRIBUTING.md.

<!-- gh-comment-id:6271445349 --> @Niko1221 commented on GitHub (Oct 19, 2026): Thanks for taking the time to report this. We're resetting the tracker for 0.2.0-beta. There are more than 1,300 open issues and pull requests, too many for us to read properly, so we're closing everything that isn't being worked on right now. Closed here does not mean rejected. To reopen it takes about two minutes: 1. Re-test on 0.2.0-beta. It may already be fixed. Write down what you see. 2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other]. 3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system. 4. Comment `/reopen`. A check runs and either reopens the issue or lists what is still missing. The rules are in [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md).
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#1224
No description provided.