Skip to content

Commit

Permalink
feat(stats): Chart migration 7 (#1162)
Browse files Browse the repository at this point in the history
schedule was taken [from here]

* new contracts 24h

* new verified contracts 24h

* independent total verified contracts to double-ensuere consistency (and it's still fast)

* find timeslot script improvement for accurate representation

* adjust new accounts schedule to not intersect with completed txns

* restructure utils + single readme + improve readme
  • Loading branch information
bragov4ik authored Jan 7, 2025
1 parent 82dc056 commit 1c70b84
Show file tree
Hide file tree
Showing 27 changed files with 776 additions and 145 deletions.
8 changes: 8 additions & 0 deletions stats/config/charts.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@
"title": "Number of deployed contracts today",
"description": "Number of deployed contracts today"
},
"new_contracts_24h": {
"title": "Contracts indexed within last 24h",
"description": "(24h)"
},
"total_contracts": {
"title": "Total contracts",
"description": "Number of contracts"
Expand All @@ -77,6 +81,10 @@
"title": "Number of verified contracts today",
"description": "Number of contracts verified today"
},
"new_verified_contracts_24h": {
"title": "Number of verified contracts within last 24h",
"description": "(24h)"
},
"total_verified_contracts": {
"title": "Total verified contracts",
"description": "Number of verified contracts"
Expand Down
2 changes: 2 additions & 0 deletions stats/config/layout.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"completed_txns",
"last_new_contracts",
"last_new_verified_contracts",
"new_contracts_24h",
"new_verified_contracts_24h",
"total_accounts",
"total_addresses",
"total_blocks",
Expand Down
5 changes: 3 additions & 2 deletions stats/config/update_groups.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@
"new_blocks_group": "0 0 8 * * * *",
"txns_fee_group": "0 0 7 * * * *",
"txns_success_rate_group": "0 0 19 * * * *",
"new_accounts_group": "0 0 5 * * * *",
"new_accounts_group": "0 0 4 * * * *",
"new_contracts_group": "0 20 */3 * * * *",
"new_txns_group": "0 10 */3 * * * *",
"new_verified_contracts_group": "0 30 */3 * * * *",
"native_coin_holders_growth_group": "0 0 7,17,22 * * * *",
"new_native_coin_transfers_group": "0 0 3,13 * * * *",
"txns_stats_24h_group": "0 30 * * * * *"
"txns_stats_24h_group": "0 30 * * * * *",
"verified_contracts_page_group": "0 15,45 * * * * *"
}
}
11 changes: 0 additions & 11 deletions stats/config/utils/README.md

This file was deleted.

32 changes: 32 additions & 0 deletions stats/config/utils/free_timeslots/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Update timeslots visualization

## Preparations

1. Install tkinter (e.g. `apt-get install python3-tk` or `brew install python-tk`) for `find_free_timeslot.py` GUI
2. Install other dependencies from `requirements.txt`: `pip install -r requirements.txt`

## `find_free_timeslot.py`

It's a tool to roughly visualize the busyness of update schedule to find a timeslot for some new update group.

### Usage

Just run `python find_free_timeslot.py` and use GUI to find less crowded timeslots.
You can regenerate durations config for more accurate representation.
See below for details

## Durations config

This is a script to generate a config for an accurate visualization within `find_free_timeslot` script.

### Usage

1. Get data fetch time statistics (e.g. from grafana) (example: `data.csv.example`). In our case, you can:
- Open "Microservices > Stats" dashboard
- Find "Average data fetch time"
- [Three dots] > [Inspect] > [Data]
- [Data options] > [Show data frame] > [Series joined by time]
- [Formatted data] = off
- [Download CSV]
2. Run the script (preferably from this folder, to correctly use default parameters) (see `--help` for details)
3. Enjoy newly generated `durations.json` after running `find_free_timeslot` script.
1 change: 1 addition & 0 deletions stats/config/utils/free_timeslots/durations/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.csv
2 changes: 2 additions & 0 deletions stats/config/utils/free_timeslots/durations/data.csv.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
"Time","accountsGrowth_DAY","accountsGrowth_MONTH","accountsGrowth_WEEK","accountsGrowth_YEAR","activeAccounts_DAY","averageBlockRewards_DAY","averageBlockRewards_MONTH","averageBlockRewards_WEEK","averageBlockRewards_YEAR","averageBlockSize_DAY","averageBlockSize_MONTH","averageBlockSize_WEEK","averageBlockSize_YEAR","averageBlockTime_DAY","averageGasLimit_DAY","averageGasLimit_MONTH","averageGasLimit_WEEK","averageGasLimit_YEAR","averageGasPrice_DAY","averageGasPrice_MONTH","averageGasPrice_WEEK","averageGasPrice_YEAR","averageTxnFee_DAY","averageTxnFee_MONTH","averageTxnFee_WEEK","averageTxnFee_YEAR","completedTxns_DAY","gasUsedGrowth_DAY","gasUsedGrowth_MONTH","gasUsedGrowth_WEEK","gasUsedGrowth_YEAR","lastNewVerifiedContracts_DAY","newAccounts_DAY","newAccounts_MONTH","newAccounts_WEEK","newAccounts_YEAR","newBlockRewards_DAY","newBlocks_DAY","newBlocks_MONTH","newBlocks_WEEK","newBlocks_YEAR","newNativeCoinTransfers_DAY","newNativeCoinTransfers_MONTH","newNativeCoinTransfers_WEEK","newNativeCoinTransfers_YEAR","newTxns_DAY","newTxns_MONTH","newTxns_WEEK","newTxns_YEAR","newVerifiedContracts_DAY","newVerifiedContracts_MONTH","newVerifiedContracts_WEEK","newVerifiedContracts_YEAR","totalAccounts_DAY","totalAddresses_DAY","totalBlocks_DAY","totalNativeCoinTransfers_DAY","totalTokens_DAY","totalTxns_DAY","totalVerifiedContracts_DAY","txnsFee_DAY","txnsFee_MONTH","txnsFee_WEEK","txnsFee_YEAR","txnsGrowth_DAY","txnsGrowth_MONTH","txnsGrowth_WEEK","txnsGrowth_YEAR","txnsSuccessRate_DAY","txnsSuccessRate_MONTH","txnsSuccessRate_WEEK","txnsSuccessRate_YEAR","verifiedContractsGrowth_DAY","verifiedContractsGrowth_MONTH","verifiedContractsGrowth_WEEK","verifiedContractsGrowth_YEAR"
1735022010000,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34,12.34
42 changes: 42 additions & 0 deletions stats/config/utils/free_timeslots/durations/durations.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"active_accounts_group": 1,
"average_block_time_group": 1,
"completed_txns_group": 19,
"pending_txns_group": 1,
"total_addresses_group": 3,
"total_blocks_group": 1,
"total_txns_group": 1,
"total_operational_txns_group": 1,
"total_tokens_group": 1,
"yesterday_txns_group": 1,
"active_recurring_accounts_daily_recurrence60_days_group": 1,
"active_recurring_accounts_monthly_recurrence60_days_group": 1,
"active_recurring_accounts_weekly_recurrence60_days_group": 1,
"active_recurring_accounts_yearly_recurrence60_days_group": 1,
"active_recurring_accounts_daily_recurrence90_days_group": 1,
"active_recurring_accounts_monthly_recurrence90_days_group": 1,
"active_recurring_accounts_weekly_recurrence90_days_group": 1,
"active_recurring_accounts_yearly_recurrence90_days_group": 1,
"active_recurring_accounts_daily_recurrence120_days_group": 1,
"active_recurring_accounts_monthly_recurrence120_days_group": 1,
"active_recurring_accounts_weekly_recurrence120_days_group": 1,
"active_recurring_accounts_yearly_recurrence120_days_group": 1,
"new_txns_window_group": 1,
"average_block_rewards_group": 1,
"average_block_size_group": 1,
"average_gas_limit_group": 1,
"average_gas_price_group": 1,
"average_txn_fee_group": 1,
"gas_used_growth_group": 1,
"native_coin_supply_group": 1,
"new_blocks_group": 1,
"txns_fee_group": 1,
"txns_success_rate_group": 2,
"txns_stats24h_group": 1,
"new_accounts_group": 102,
"new_contracts_group": 1,
"new_txns_group": 1,
"new_verified_contracts_group": 1,
"native_coin_holders_growth_group": 1,
"new_native_coin_transfers_group": 1
}
Loading

0 comments on commit 1c70b84

Please sign in to comment.