Add per-minute net worth series - #92
Open
geracosta wants to merge 1 commit into
Open
Conversation
Net worth is already read from the entity state on every interval tick but only the final value survives into the blob. Emit it as networth_t next to gold_t, so the API can serve a net worth curve instead of a single number. Replays that don't expose the field leave the array empty, same as camps_stacked_t.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
networth_t, a per-minute net worth series, next to the existinggold_t/xp_t/lh_t/dn_t.The value is already read from the entity state on every interval tick, it just never makes it into the blob: only the final
net_worthsurvives. Someone asked for this on Discord (they wanted net worth over time rather than a single number) andgold_tisn't a substitute, since it's total earned gold: at 0:00 net worth is 600 from the starting gold while earned gold is 0, and the two drift further apart with buybacks and consumables.Semantics match the existing series: samples land on whole minutes, so the last partial minute isn't included. On the match I validated with (42:36), the last sample is at 42:00 and the remaining 36s show up as a gap against Valve's final
net_worth: negative for players still earning, positive for the three who bought back at the end.Validation:
times/gold_tand start at 600.camps_stacked_tdoes today, so old replays cost nothing.Storage: +1.3 KB gzip per match on that 42 minute game (43441 -> 44792 bytes gzipped).
odota/web#3375 uses it for a Net Worth graph on the Graphs tab, which is the curve every broadcast shows and the site doesn't have yet.