Skip to content

Commit

Permalink
chore: update metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
0xdeafbeef committed Jun 20, 2024
1 parent 99c0f7a commit 13c3fc6
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 43 deletions.
2 changes: 1 addition & 1 deletion cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fn main() -> ExitCode {

rayon::ThreadPoolBuilder::new()
.stack_size(8 * 1024 * 1024)
.thread_name(|i| format!("rayon-{i}"))
.thread_name(|_| "rayon_worker".to_string())
.build_global()
.unwrap();

Expand Down
4 changes: 2 additions & 2 deletions collator/src/collator/do_collate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -575,8 +575,8 @@ impl CollatorStdImpl {
// block time diff from now
let block_time_diff = {
let diff_time = now_millis() as i64 - next_chain_time as i64;
metrics::histogram!("tycho_do_collate_block_diff_time", labels)
.record(diff_time as f64 / 1000.0);
metrics::gauge!("tycho_do_collate_block_time_diff", labels)
.set(diff_time as f64 / 1000.0);
diff_time
};

Expand Down
1 change: 0 additions & 1 deletion collator/src/state_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use everscale_types::boc::BocRepr;
use everscale_types::models::*;
use everscale_types::prelude::*;
use tokio::sync::broadcast;
use tokio::time::Instant;
use tycho_block_util::archive::ArchiveData;
use tycho_block_util::block::{BlockProofStuff, BlockStuff, BlockStuffAug};
use tycho_block_util::state::ShardStateStuff;
Expand Down
107 changes: 68 additions & 39 deletions scripts/gen-dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,15 +387,18 @@ def jrpc() -> RowPanel:
def collator_finalize_block() -> RowPanel:
metrics = [
create_heatmap_panel(
"tycho_collator_finalize_block_time", "Total time to finalize block",
"tycho_collator_finalize_block_time",
"Total time to finalize block",
labels=['workchain=~"$workchain"'],
),
create_heatmap_panel(
"tycho_collator_finalize_build_account_blocks_time", "Build account blocks",
"tycho_collator_finalize_build_account_blocks_time",
"Build account blocks",
labels=['workchain=~"$workchain"'],
),
create_heatmap_panel(
"tycho_collator_finalize_build_in_msgs_time", "Build InMsgDescr",
"tycho_collator_finalize_build_in_msgs_time",
"Build InMsgDescr",
labels=['workchain=~"$workchain"'],
),
create_heatmap_panel(
Expand All @@ -404,19 +407,23 @@ def collator_finalize_block() -> RowPanel:
labels=['workchain=~"$workchain"'],
),
create_heatmap_panel(
"tycho_collator_finish_build_mc_state_extra_time", "Build McStateExtra",
"tycho_collator_finish_build_mc_state_extra_time",
"Build McStateExtra",
labels=['workchain=~"$workchain"'],
),
create_heatmap_panel(
"tycho_collator_finalize_build_state_update_time", "Compute MerkleUpdate",
"tycho_collator_finalize_build_state_update_time",
"Compute MerkleUpdate",
labels=['workchain=~"$workchain"'],
),
create_heatmap_panel(
"tycho_collator_finalize_build_block_time", "Build Block",
"tycho_collator_finalize_build_block_time",
"Build Block",
labels=['workchain=~"$workchain"'],
),
create_heatmap_panel(
"tycho_collator_finalize_build_new_state_time", "Build State",
"tycho_collator_finalize_build_new_state_time",
"Build State",
labels=['workchain=~"$workchain"'],
),
]
Expand All @@ -431,32 +438,35 @@ def collator_do_collate() -> RowPanel:
labels=['workchain=~"$workchain"'],
),
create_counter_panel(
"tycho_do_collate_msgs_exec_count_all", "All executed msgs count",
"tycho_do_collate_msgs_exec_count_all",
"All executed msgs count",
labels=['workchain=~"$workchain"'],
),

create_counter_panel(
"tycho_collator_ext_msgs_imported_count", "Imported Ext msgs count from mempool",
"tycho_collator_ext_msgs_imported_count",
"Imported Ext msgs count from mempool",
labels=['workchain=~"$workchain"'],
),
create_counter_panel(
"tycho_do_collate_msgs_read_count_ext", "Read Ext msgs count",
"tycho_do_collate_msgs_read_count_ext",
"Read Ext msgs count",
labels=['workchain=~"$workchain"'],
),
create_counter_panel(
"tycho_do_collate_msgs_exec_count_ext", "Executed Ext msgs count",
"tycho_do_collate_msgs_exec_count_ext",
"Executed Ext msgs count",
labels=['workchain=~"$workchain"'],
),

create_counter_panel(
"tycho_do_collate_msgs_read_count_int", "Read Int msgs count",
"tycho_do_collate_msgs_read_count_int",
"Read Int msgs count",
labels=['workchain=~"$workchain"'],
),
create_counter_panel(
"tycho_do_collate_msgs_exec_count_int", "Executed Int msgs count",
"tycho_do_collate_msgs_exec_count_int",
"Executed Int msgs count",
labels=['workchain=~"$workchain"'],
),

create_counter_panel(
"tycho_do_collate_new_msgs_created_count",
"Created NewInt msgs count",
Expand All @@ -468,70 +478,85 @@ def collator_do_collate() -> RowPanel:
labels=['workchain=~"$workchain"'],
),
create_counter_panel(
"tycho_do_collate_msgs_read_count_new_int", "Read NewInt msgs count",
"tycho_do_collate_msgs_read_count_new_int",
"Read NewInt msgs count",
labels=['workchain=~"$workchain"'],
),
create_counter_panel(
"tycho_do_collate_msgs_exec_count_new_int", "Executed NewInt msgs count",
"tycho_do_collate_msgs_exec_count_new_int",
"Executed NewInt msgs count",
labels=['workchain=~"$workchain"'],
),

create_gauge_panel(
"tycho_session_iterator_messages_all", "Number of internals in the iterator",
"tycho_session_iterator_messages_all",
"Number of internals in the iterator",
labels=['workchain=~"$workchain"'],
),
create_gauge_panel(
"tycho_do_collate_int_msgs_queue_calc", "Calculated Internal queue len"
),
create_counter_panel(
"tycho_do_collate_int_enqueue_count", "Enqueued int msgs count",
"tycho_do_collate_int_enqueue_count",
"Enqueued int msgs count",
),
create_counter_panel(
"tycho_do_collate_int_dequeue_count", "Dequeued int msgs count",
"tycho_do_collate_int_dequeue_count",
"Dequeued int msgs count",
),

create_heatmap_panel(
"tycho_do_collate_block_diff_time", "Block time diff",
create_gauge_panel(
"tycho_do_collate_block_time_diff",
"Block time diff",
UNITS.SECONDS,
labels=['workchain=~"$workchain"'],
),
create_heatmap_panel(
"tycho_do_collate_from_prev_block_time", "Time elapsed from prev block",
"tycho_do_collate_from_prev_block_time",
"Time elapsed from prev block",
labels=['workchain=~"$workchain"'],
),
create_heatmap_panel(
"tycho_do_collate_overhead_time", "Collation flow overhead",
"tycho_do_collate_overhead_time",
"Collation flow overhead",
labels=['workchain=~"$workchain"'],
),
create_heatmap_panel(
"tycho_do_collate_total_time", "Total collation time",
"tycho_do_collate_total_time",
"Total collation time",
labels=['workchain=~"$workchain"'],
),
create_heatmap_panel(
"tycho_do_collate_prepare_time", "Collation prepare time",
"tycho_do_collate_prepare_time",
"Collation prepare time",
labels=['workchain=~"$workchain"'],
),
create_heatmap_panel(
"tycho_do_collate_init_iterator_time", "Init iterator time",
"tycho_do_collate_init_iterator_time",
"Init iterator time",
labels=['workchain=~"$workchain"'],
),
create_heatmap_panel(
"tycho_do_collate_execute_time", "Execution time",
"tycho_do_collate_execute_time",
"Execution time",
labels=['workchain=~"$workchain"'],
),
create_heatmap_panel(
"tycho_do_collate_execute_tick_time", "Execute Tick special transactions",
"tycho_do_collate_execute_tick_time",
"Execute Tick special transactions",
labels=['workchain=~"$workchain"'],
),
create_heatmap_panel(
"tycho_do_collate_execute_tock_time", "Execute Tock special transactions",
"tycho_do_collate_execute_tock_time",
"Execute Tock special transactions",
labels=['workchain=~"$workchain"'],
),
create_heatmap_panel(
"tycho_do_collate_fill_msgs_total_time", "Fill messages time",
"tycho_do_collate_fill_msgs_total_time",
"Fill messages time",
labels=['workchain=~"$workchain"'],
),
create_heatmap_panel(
"tycho_do_collate_exec_msgs_total_time", "Execute messages time",
"tycho_do_collate_exec_msgs_total_time",
"Execute messages time",
labels=['workchain=~"$workchain"'],
),
create_heatmap_panel(
Expand All @@ -540,19 +565,23 @@ def collator_do_collate() -> RowPanel:
labels=['workchain=~"$workchain"'],
),
create_heatmap_panel(
"tycho_do_collate_apply_queue_diff_time", "Apply message queue diff",
"tycho_do_collate_apply_queue_diff_time",
"Apply message queue diff",
labels=['workchain=~"$workchain"'],
),
create_heatmap_panel(
"tycho_do_collate_handle_block_candidate_time", "Handle block candidate",
"tycho_do_collate_handle_block_candidate_time",
"Handle block candidate",
labels=['workchain=~"$workchain"'],
),
create_heatmap_panel(
"tycho_collator_update_mc_data_time", "update mc data",
"tycho_collator_update_mc_data_time",
"update mc data",
labels=['workchain=~"$workchain"'],
),
create_heatmap_panel(
"tycho_collator_import_next_anchor_time", "import next anchor time",
"tycho_collator_import_next_anchor_time",
"import next anchor time",
labels=['workchain=~"$workchain"'],
),
create_heatmap_panel(
Expand Down

0 comments on commit 13c3fc6

Please sign in to comment.