Skip to content

Commit

Permalink
feat(stats): The Migration of The Backend charts: Total Blocks and Dy…
Browse files Browse the repository at this point in the history
…namic query dispatch (#1137)

#1080

It is a sequel to #1120 and the third installment in the Migrate Backend Charts franchise.

In this standalone sequel, we introduce reimagination of TotalBlocks counter and dynamic dispatch for chart query behaviour. TotalBlocks counter uses a custom logic with fallback to postgres catalog for preliminary block number estimation (to display when SQL query is not yet calculated), so we can't keep retrieving the data directly from DB. We need to allow dynamic query logic that is configurable for each chart.

While adding usage of dynamic logic for chart query, regular date range was replaced by universal range, because chart requests can include or omit any of the bounds.
  • Loading branch information
bragov4ik authored Dec 11, 2024
1 parent 7e92156 commit 2be4467
Show file tree
Hide file tree
Showing 91 changed files with 2,651 additions and 1,250 deletions.
15 changes: 14 additions & 1 deletion stats/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions stats/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ members = [
blockscout-client = { git = "https://github.com/blockscout/blockscout-rs/", rev = "506b821" }
blockscout-service-launcher = { version = "0.13.1" }
rstest = "0.23.0"
trait-variant = "0.1.2"
wiremock = "0.6.2"

# todo: update version after https://github.com/chronotope/chrono/pull/1600
Expand Down
2 changes: 1 addition & 1 deletion stats/config/update_groups.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"average_block_time_group": "0 */10 * * * * *",
"completed_txns_group": "0 5 */3 * * * *",
"total_addresses_group": "0 0 */3 * * * *",
"total_blocks_group": "0 0 */3 * * * *",
"total_blocks_group": "0 0 */2 * * * *",
"total_tokens_group": "0 0 18 * * * *",
"yesterday_txns_group": "0 8 0 * * * *",
"active_recurring_accounts_daily_recurrence_60_days_group": "0 0 2 * * * *",
Expand Down
Loading

0 comments on commit 2be4467

Please sign in to comment.