Skip to content

fix(tracking): weight by-command savings percentage - #3510

Open
cakeni wants to merge 1 commit into
rtk-ai:developfrom
cakeni:codex/gain-weighted-percentage
Open

fix(tracking): weight by-command savings percentage#3510
cakeni wants to merge 1 commit into
rtk-ai:developfrom
cakeni:codex/gain-weighted-percentage

Conversation

@cakeni

@cakeni cakeni commented Aug 10, 2026

Copy link
Copy Markdown

Summary

  • derive each by-command savings percentage from aggregate saved and input token totals
  • label the weighted value as Total% instead of Avg%
  • cover weighted long-tail command data and zero-input passthrough records

Closes #3506

Test plan

  • cargo fmt --all --check
  • cargo clippy --all-targets
  • cargo test --all -- --test-threads=1
  • targeted regression test confirmed red before the fix (expected 89.2079%, got 50%) and green after it
  • manual testing with an isolated RTK_DB_PATH: rtk proxy followed by rtk gain displayed the Total% column

AI assistance was used during investigation or implementation.

Signed-off-by: cakeni <211545599+cakeni@users.noreply.github.com>
@CLAassistant

CLAassistant commented Aug 10, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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.

gain: by-command table puts SUM(saved_tokens) next to AVG(savings_pct), producing rows that can't be read together

2 participants