Skip to content

Add token/s on dashboard and reporting token/s in the metrics endpoint - #265

Open
ndragon798 wants to merge 6 commits into
intentee:mainfrom
ndragon798:tokenpersecond
Open

Add token/s on dashboard and reporting token/s in the metrics endpoint#265
ndragon798 wants to merge 6 commits into
intentee:mainfrom
ndragon798:tokenpersecond

Conversation

@ndragon798

Copy link
Copy Markdown

Added reporting tokens per second in the dashboard and total tokens per second in metrics
image
From the metrics endpoint

# HELP paddler_tokens_per_second Combined generation throughput across all agents
# TYPE paddler_tokens_per_second gauge
paddler_tokens_per_second 60.199918546700225

This is done by counting the amount of generation in the SampleTokenPhase then its sent off to a throughput meter which is just a rolling 1 second window. This is sent from the agent via the status snapshot that the agent sends once per second. Lots of this was done by Claude with me fixing issues that it had with building the binaries and testing. I only was able to test this on 3 machines that are amd/cpu based. I don't think there will be any issues with nvidia but please test if you have an nvidia gpu. Also tested with the desktop app which only seems to do cpu and not vulkan?

Let me know if you have any questions or run into any issues.

Thanks,
Nathan

@ndragon798 ndragon798 changed the title Tokenpersecond Add token/s on dashboard and reporting token/s in the metrics endpoint Aug 14, 2026
@ndragon798
ndragon798 marked this pull request as draft August 14, 2026 14:18
@ndragon798
ndragon798 marked this pull request as ready for review August 14, 2026 14:44
@mcharytoniuk

mcharytoniuk commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

@ndragon798 thank you for the PR! Generally the implementation is fine, I'm just wondering about that flaky test; adding 10ms timeout really just masks the issue/masks some underlying problem of a different kind (because being flaky might be really exposing some issue with service manager, or maybe some different component). It would be nice to dig deeper and identify what might be the cause. We primarily tested on CUDA + Metal, so maybe we missed something on Vulkan/AMD.

Even if you are doing this with Claude you can forward my remark to it. If possible try to ask it to find a core, underlying issue, we might have some luck with it. :)

@ndragon798

Copy link
Copy Markdown
Author

TL;DR

The test assumed a TCP connect to a just-closed loopback port is refused
immediately. The kernel does not guarantee that. Empirically, Linux
sometimes takes ~0.9–1.7 s to answer such a connect with
ECONNREFUSED. The test's 5 s budget (SHUTDOWN_BUDGET) is meant to catch
"blocks forever", but a single slow refusal plus the websocket/hyper
handshake overhead pushed the observed single-attempt time past 5 s in the
repro, failing with Elapsed(()).

The 10 ms sleep added in 37c2b67e was a band-aid: 10 ms is five orders
of magnitude smaller than the ~1 s kernel slow-refusal window, so it could
never actually fix the failure mode. It made the flake rarer (or masked the
exact timing that hit), not deterministic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants