Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add few more metrics data points #19624

Merged
merged 5 commits into from
Sep 15, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Collect metrics for determining transaction cost elements
- add slot, count and accumulated-units to per-program-timings
- bump sigverify stats from debug to info
  • Loading branch information
tao-stones committed Sep 14, 2021
commit 6e7b0e0405f822b84e3a3e7fecdc9e31976dce4c
17 changes: 14 additions & 3 deletions core/src/progress_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,18 +124,29 @@ impl ReplaySlotStats {
.iter()
.collect();
per_pubkey_timings.sort_by(|a, b| b.1.accumulated_us.cmp(&a.1.accumulated_us));
let total: u64 = per_pubkey_timings.iter().map(|a| a.1.accumulated_us).sum();
let total_us: u64 = per_pubkey_timings.iter().map(|a| a.1.accumulated_us).sum();
let total_units: u64 = per_pubkey_timings
.iter()
.map(|a| a.1.accumulated_units)
.sum();
let total_count: u32 = per_pubkey_timings.iter().map(|a| a.1.count).sum();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could collapse these sum()s with something like:

let (total_us, total_units, total_count) = per_pubkey_timings.iter().fold((0,0,0), |(sum_us, sum_units, sum_count), a| (sum_us + a.1.accumulated_us, sum_units + a.1.accumulated_units, sum_count + a.1.count));

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

neat! Thanks!

for (pubkey, time) in per_pubkey_timings.iter().take(5) {
datapoint_info!(
"per_program_timings",
("slot", slot as i64, i64),
("pubkey", pubkey.to_string(), String),
("execute_us", time.accumulated_us, i64)
("execute_us", time.accumulated_us, i64),
("accumulated_units", time.accumulated_units, i64),
("count", time.count, i64)
);
}
datapoint_info!(
"per_program_timings",
("slot", slot as i64, i64),
("pubkey", "all", String),
("execute_us", total, i64)
("execute_us", total_us, i64),
("accumulated_units", total_units, i64),
("count", total_count, i64)
);
}
}
Expand Down
4 changes: 2 additions & 2 deletions core/src/sigverify_stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use crate::sigverify;
use crossbeam_channel::{SendError, Sender as CrossbeamSender};
use solana_measure::measure::Measure;
use solana_metrics::datapoint_debug;
use solana_metrics::datapoint_info;
use solana_perf::packet::Packets;
use solana_perf::perf_libs;
use solana_sdk::timing;
Expand Down Expand Up @@ -97,7 +97,7 @@ impl SigVerifyStage {
(len as f32 / verify_batch_time.as_s())
);

datapoint_debug!(
datapoint_info!(
tao-stones marked this conversation as resolved.
Show resolved Hide resolved
"sigverify_stage-total_verify_time",
("num_batches", batch_len, i64),
("num_packets", len, i64),
Expand Down