-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Tree Backfiller] Metrics and Logging (#115)
* refactor(backfiller): tree backfilling using getSignaturesForAdress. fetch all trees, fetch associated transactions * feat(backfiller): generate table and model for query last transaction record for fast forwarding tree transaction crawling * feat(backfiller): push transaction payloads to redis through the perkle messenger. mark tree transactons as processed_at so know it completed the index loop. * fix(backfiller): git history changes made from running formatter. just include changes needed by the backfiller. * fix(backfiller): support mock feature for sea-orm by switching to pg pool and sea_orm adapter. * feat(backfiller): emit performance and reliability metrics to statsd * refactor(backfiller): only backfill trees from finalized blocks * refactor(backfiller): skip queueing a transaction that is already processed at
- Loading branch information
1 parent
315216c
commit c30a5c4
Showing
9 changed files
with
276 additions
and
54 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
|
||
|
||
|
||
# Tree Backfiller | ||
|
||
The Tree Backfiller crawls all trees on-chain and backfills any transactions related to a tree that have not already been observed. | ||
|
||
## Commands | ||
|
||
Command line arguments can also be set through environment variables. | ||
|
||
### Run | ||
|
||
The `run` command initiates the crawling and backfilling process. It requires the Solana RPC URL, the database URL, and the messenger Redis URL. | ||
|
||
``` | ||
Usage: das-tree-backfiller run [OPTIONS] --solana-rpc-url <SOLANA_RPC_URL> --database-url <DATABASE_URL> --messenger-redis-url <MESSENGER_REDIS_URL> | ||
Options: | ||
--solana-rpc-url <SOLANA_RPC_URL> | ||
Solana RPC URL [env: SOLANA_RPC_URL=https://index.rpcpool.com/a4d23a00546272efeba9843a4ae4R] | ||
--tree-crawler-count <TREE_CRAWLER_COUNT> | ||
Number of tree crawler workers [env: TREE_CRAWLER_COUNT=] [default: 100] | ||
--signature-channel-size <SIGNATURE_CHANNEL_SIZE> | ||
The size of the signature channel. This is the number of signatures that can be queued up. [env: SIGNATURE_CHANNEL_SIZE=] [default: 10000] | ||
--queue-channel-size <QUEUE_CHANNEL_SIZE> | ||
[env: QUEUE_CHANNEL_SIZE=] [default: 1000] | ||
--database-url <DATABASE_URL> | ||
[env: DATABASE_URL=postgres://solana:solana@localhost:5432/solana] | ||
--database-max-connections <DATABASE_MAX_CONNECTIONS> | ||
[env: DATABASE_MAX_CONNECTIONS=] [default: 125] | ||
--database-min-connections <DATABASE_MIN_CONNECTIONS> | ||
[env: DATABASE_MIN_CONNECTIONS=] [default: 5] | ||
--messenger-redis-url <MESSENGER_REDIS_URL> | ||
[env: MESSENGER_REDIS_URL=redis://localhost:6379] | ||
--messenger-redis-batch-size <MESSENGER_REDIS_BATCH_SIZE> | ||
[env: MESSENGER_REDIS_BATCH_SIZE=] [default: 100] | ||
--messenger-stream-max-buffer-size <MESSENGER_STREAM_MAX_BUFFER_SIZE> | ||
[env: MESSENGER_STREAM_MAX_BUFFER_SIZE=] [default: 10000000] | ||
--metrics-host <METRICS_HOST> | ||
[env: METRICS_HOST=] [default: 127.0.0.1] | ||
--metrics-port <METRICS_PORT> | ||
[env: METRICS_PORT=] [default: 8125] | ||
-h, --help | ||
Print help | ||
``` | ||
|
||
### Metrics | ||
|
||
The Tree Backfiller provides several metrics for monitoring performance and status: | ||
|
||
Metric | Description | ||
--- | --- | ||
transaction.workers | Gauge of active worker threads | ||
transaction.failed | Count of failed transaction | ||
transaction.queued | Time for a transaction to be queued | ||
tree.crawled | Time to crawl a tree | ||
tree.completed | Count of completed tree crawl | ||
tree.failed | Count of failed tree crawls | ||
job.completed | Time to complete the job |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
mod backfiller; | ||
mod db; | ||
mod metrics; | ||
mod queue; | ||
mod tree; | ||
|
||
|
Oops, something went wrong.