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 buckets for timers #4548

Merged
merged 1 commit into from
Sep 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 3 additions & 0 deletions crates/sui-benchmark/src/drivers/bench_driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ pub struct BenchMetrics {
pub latency_s: HistogramVec,
}

const LATENCY_SEC_BUCKETS: &[f64] = &[0.01, 0.1, 1., 2., 3., 5., 10., 20., 30., 60., 180.];

impl BenchMetrics {
fn new(registry: &Registry) -> Self {
BenchMetrics {
Expand Down Expand Up @@ -78,6 +80,7 @@ impl BenchMetrics {
"latency_s",
"Total time in seconds to return a response",
&["workload"],
LATENCY_SEC_BUCKETS.to_vec(),
registry,
)
.unwrap(),
Expand Down
7 changes: 7 additions & 0 deletions crates/sui-core/src/authority.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ const POSITIVE_INT_BUCKETS: &[f64] = &[
1., 2., 5., 10., 20., 50., 100., 200., 500., 1000., 2000., 5000., 10000., 20000., 50000.,
];

const LATENCY_SEC_BUCKETS: &[f64] = &[0.001, 0.01, 0.1, 1., 2., 3., 5., 10., 20., 30., 60., 180.];

impl AuthorityMetrics {
pub fn new(registry: &prometheus::Registry) -> AuthorityMetrics {
// buckets are: 100, 10k, 1M, 100M, 10B, 1T, 100T, 10Q
Expand Down Expand Up @@ -241,30 +243,35 @@ impl AuthorityMetrics {
prepare_certificate_latency: register_histogram_with_registry!(
"validator_prepare_certificate_latency",
"Latency of preparing certificate",
LATENCY_SEC_BUCKETS.to_vec(),
registry,
)
.unwrap(),
commit_certificate_latency: register_histogram_with_registry!(
"validator_commit_certificate_latency",
"Latency of committing certificate",
LATENCY_SEC_BUCKETS.to_vec(),
registry,
)
.unwrap(),
handle_transaction_latency: register_histogram_with_registry!(
"validator_handle_transaction_latency",
"Latency of committing certificate",
LATENCY_SEC_BUCKETS.to_vec(),
registry,
)
.unwrap(),
handle_certificate_latency: register_histogram_with_registry!(
"validator_handle_certificate_latency",
"Latency of handling certificate",
LATENCY_SEC_BUCKETS.to_vec(),
registry,
)
.unwrap(),
handle_node_sync_certificate_latency: register_histogram_with_registry!(
"fullnode_handle_node_sync_certificate_latency",
"Latency of fullnode handling certificate from node sync",
LATENCY_SEC_BUCKETS.to_vec(),
registry,
)
.unwrap(),
Expand Down
9 changes: 9 additions & 0 deletions crates/sui-core/src/authority_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,48 +169,57 @@ pub struct ValidatorServiceMetrics {
pub handle_certificate_non_consensus_latency: Histogram,
}

const LATENCY_SEC_BUCKETS: &[f64] = &[0.001, 0.01, 0.1, 1., 2., 3., 5., 10., 20., 30., 60., 180.];

impl ValidatorServiceMetrics {
pub fn new(registry: &Registry) -> Self {
Self {
tx_verification_latency: register_histogram_with_registry!(
"validator_service_tx_verification_latency",
"Latency of verifying a transaction",
LATENCY_SEC_BUCKETS.to_vec(),
registry,
)
.unwrap(),
cert_verification_latency: register_histogram_with_registry!(
"validator_service_cert_verification_latency",
"Latency of verifying a certificate",
LATENCY_SEC_BUCKETS.to_vec(),
registry,
)
.unwrap(),
consensus_latency: register_histogram_with_registry!(
"validator_service_consensus_latency",
"Time spent between submitting a shared obj txn to consensus and getting result",
LATENCY_SEC_BUCKETS.to_vec(),
registry,
)
.unwrap(),
handle_transaction_consensus_latency: register_histogram_with_registry!(
"validator_service_handle_transaction_consensus_latency",
"Latency of handling a consensus transaction",
LATENCY_SEC_BUCKETS.to_vec(),
registry,
)
.unwrap(),
handle_transaction_non_consensus_latency: register_histogram_with_registry!(
"validator_service_handle_transaction_non_consensus_latency",
"Latency of handling a non-consensus transaction",
LATENCY_SEC_BUCKETS.to_vec(),
registry,
)
.unwrap(),
handle_certificate_consensus_latency: register_histogram_with_registry!(
"validator_service_handle_certificate_consensus_latency",
"Latency of handling a consensus transaction certificate",
LATENCY_SEC_BUCKETS.to_vec(),
registry,
)
.unwrap(),
handle_certificate_non_consensus_latency: register_histogram_with_registry!(
"validator_service_handle_certificate_non_consensus_latency",
"Latency of handling a non-consensus transaction certificate",
LATENCY_SEC_BUCKETS.to_vec(),
registry,
)
.unwrap(),
Expand Down