diff options
| author | Denys Fedoryshchenko <denys.f@collabora.com> | 2026-05-14 01:06:49 +0300 |
|---|---|---|
| committer | Denys Fedoryshchenko <denys.f@collabora.com> | 2026-05-14 10:04:56 +0300 |
| commit | 5358369d7b7965deda010267076b25e25c4c044a (patch) | |
| tree | 84249be2fc616452cb598e77d153bd0f42a44b94 /kernel/patch | |
| parent | d200bdcb39f754ac360b78bf408a3c66f50e8a8c (diff) | |
| download | accel-ppp-5358369d7b7965deda010267076b25e25c4c044a.tar.gz accel-ppp-5358369d7b7965deda010267076b25e25c4c044a.zip | |
metrics: render JSON when format=json
Replace the previous `{}` stub with a structured JSON document carrying
the same fields as the Prometheus exposition: build info, uptime,
CPU%, RSS/virtual memory, the triton core counters, session counts by
state, and a `protocols` object whose keys are only present for
modules that are actually loaded.
Strings are emitted through a small helper that escapes the JSON
control characters (\b, \f, \n, \r, \t, \", \\) and falls back to
\u00XX for other bytes below 0x20, so the version string and any
future textual labels survive without producing invalid JSON. The
output passes `python3 -m json.tool` against a running daemon.
Content-Type is already set to application/json by content_type(), so
no transport changes are needed.
Signed-off-by: Denys Fedoryshchenko <denys.f@collabora.com>
Diffstat (limited to 'kernel/patch')
0 files changed, 0 insertions, 0 deletions
