Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tx_volume stats: Produce windowed results, recompute more efficiently #866

Closed
csillag opened this issue Dec 30, 2024 · 1 comment
Closed

Comments

@csillag
Copy link
Contributor

csillag commented Dec 30, 2024

We compute the tx_volume stats in a materialized view in a wasteful manner: Every time we refresh the stats, the numbers are recomputed for every timestamp in the past, even the ones for which we already have the stats computed. It was easy to code but has downsides:

  • costs CPU on the DB cluster (no big deal)
  • the 5-min-granularity stats are not refreshed every 5 minutes

The logic from dailyActiveAccountsWorker can likely be reused to compute the stats incrementally.

Additional new requirement from frontend: Provide 24h tx volume at every 5-min timestamp (=windowed sum), much like the /{layer}/stats/active_accounts endpoint. Currently, we provide only the total tx volume for each calendar day.

@csillag
Copy link
Contributor Author

csillag commented Dec 30, 2024

Closed by #477.

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

No branches or pull requests

1 participant