Skip to content

Commit 58ef312

Browse files
committed
feat(collator): add boc cache capacity metrics
1 parent 96e61b8 commit 58ef312

File tree

5 files changed

+29
-9
lines changed

5 files changed

+29
-9
lines changed

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ tycho-storage = { path = "./storage", version = "0.2.8" }
135135
tycho-util = { path = "./util", version = "0.2.8" }
136136

137137
[patch.crates-io]
138-
everscale-types = { git = "https://github.com/broxus/everscale-types.git", rev = "859a32c8aeb0eaaf97d43d6c3eaa8e68d34ad117" }
138+
everscale-types = { git = "https://github.com/broxus/everscale-types.git", rev = "a596bafc8362a5026e35c741ee52715764a96925" }
139139

140140
[workspace.lints.rust]
141141
future_incompatible = "warn"

collator/src/collator/do_collate/finalize.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,16 @@ impl Phase<FinalizeState> {
651651
block_serializer_cache.take_boc_header_cache(),
652652
);
653653
header.encode_rayon(&mut data);
654-
block_serializer_cache.set_boc_header_cache(header.into_cache());
654+
655+
let cache = header.into_cache();
656+
let rev_indices_capacity = cache.rev_indices_capacity();
657+
let rev_cells_capacity = cache.rev_cells_capacity();
658+
block_serializer_cache.set_boc_header_cache(cache);
659+
660+
metrics::gauge!("tycho_collator_boc_cache_rev_indices_capacity", labels)
661+
.set(rev_indices_capacity as f64);
662+
metrics::gauge!("tycho_collator_boc_cache_rev_cells_capacity", labels)
663+
.set(rev_cells_capacity as f64);
655664
};
656665

657666
let block_id = BlockId {

collator/src/collator/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ impl CollatorStdImpl {
260260
mempool_config_override: Option<MempoolGlobalConfig>,
261261
cancel_collation: Arc<Notify>,
262262
) -> Result<AsyncQueuedDispatcher<Self>> {
263-
const BLOCK_CELL_COUNT_BASELINE: usize = 1_000_000;
263+
const BLOCK_CELL_COUNT_BASELINE: usize = 100_000;
264264

265265
let next_block_info = calc_next_block_id_short(&prev_blocks_ids);
266266

scripts/gen-dashboard.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -822,7 +822,9 @@ def storage() -> RowPanel:
822822
unit=UNITS.PERCENT_FORMAT,
823823
),
824824
create_gauge_panel(
825-
"tycho_storage_raw_cells_cache_size", "Raw cells cache size", UNITS.BYTES_IEC
825+
"tycho_storage_raw_cells_cache_size",
826+
"Raw cells cache size",
827+
UNITS.BYTES_IEC,
826828
),
827829
create_heatmap_quantile_panel(
828830
"tycho_storage_store_block_data_size",
@@ -1036,6 +1038,16 @@ def collator_finalize_block() -> RowPanel:
10361038
"inc. Create MerkleUpdate",
10371039
labels=['workchain=~"$workchain"'],
10381040
),
1041+
create_gauge_panel(
1042+
"tycho_collator_boc_cache_rev_indices_capacity",
1043+
"BOC Cache rev_indices capacity",
1044+
labels=['workchain=~"$workchain"'],
1045+
),
1046+
create_gauge_panel(
1047+
"tycho_collator_boc_cache_rev_cells_capacity",
1048+
"BOC Cache rev_cells capacity",
1049+
labels=['workchain=~"$workchain"'],
1050+
),
10391051
create_heatmap_panel(
10401052
"tycho_collator_finalize_build_block_time",
10411053
"Build Block",
@@ -1381,7 +1393,6 @@ def collator_queue_metrics() -> RowPanel:
13811393
"Queue clean until",
13821394
legend_format=legend_format,
13831395
),
1384-
13851396
create_heatmap_panel(
13861397
"tycho_internal_queue_gc_execute_task_time", "GC execute time"
13871398
),
@@ -1419,7 +1430,7 @@ def collator_queue_metrics() -> RowPanel:
14191430
by_labels=["instance", "partition"],
14201431
),
14211432
create_heatmap_panel(
1422-
"tycho_internal_queue_apply_diff_add_statistics_time",
1433+
"tycho_internal_queue_apply_diff_add_statistics_time",
14231434
"Apply diff: add statistics time",
14241435
),
14251436
create_heatmap_panel(

0 commit comments

Comments
 (0)