Skip to content
This repository was archived by the owner on Oct 7, 2026. It is now read-only.

feat(admin): read server and library stats from the kmrs stats endpoints - #124

Merged
everpcpc merged 1 commit into
masterfrom
feat/server-stats-endpoints
Oct 6, 2026
Merged

everpcpc merged 1 commit into
masterfrom
feat/server-stats-endpoints

Conversation

@everpcpc

@everpcpc everpcpc commented Oct 6, 2026

Copy link
Copy Markdown
Member

Summary

Switch the admin UI's metric fetching from the Spring-style /actuator/metrics/* endpoints to the kmrs-native stats endpoints added in kmrs (GET /api/v1/stats/libraries, GET /api/v1/stats/server).

Changes

  • statsApi gains libraries() and server(); actuatorApi loses metric/metricNames. The remaining actuator endpoints (health, sessions, scheduledtasks, logfile, shutdown) are untouched.
  • StatsGrid reads uptime/CPU/memory from the server snapshot's process field; CPU is always a percent now, so the ratio-vs-percent branch goes away.
  • ContentCounts takes libraries/collections/readlists from the server totals and series/books/file size from the libraries total.
  • TaskExecutionPanel iterates the per-type rows (queue depth and execution metrics are merged server-side); failures are summed across types. The aggregate-only "all tasks" row is unreachable with the merged shape, so it and its taskExecution.allTasks locale keys are removed.
  • LibraryCard finds its row in the shared libraries stats query; empty libraries report zeros, so the 404-means-zero workaround is gone.
  • The panels share two query keys (admin/stats/server, admin/stats/libraries), replacing the per-metric/per-library request fan-out with two deduplicated queries.
  • Deleted: useMetric.ts, admin/metric.ts.

Testing

  • pnpm build (tsc + vite) and pnpm lint pass.

@everpcpc
everpcpc force-pushed the feat/server-stats-endpoints branch from 29b4576 to 45c89a6 Compare October 6, 2026 13:06
@everpcpc
everpcpc marked this pull request as ready for review October 6, 2026 13:07
@everpcpc
everpcpc merged commit 87d8019 into master Oct 6, 2026
2 checks passed
@everpcpc
everpcpc deleted the feat/server-stats-endpoints branch October 6, 2026 13:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant