-
Notifications
You must be signed in to change notification settings - Fork 11.3k
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 consensus time metrics on SUI side #4584
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,11 +11,11 @@ use narwhal_executor::SubscriberResult; | |
use narwhal_types::TransactionProto; | ||
use narwhal_types::TransactionsClient; | ||
use parking_lot::Mutex; | ||
use prometheus::register_int_counter_with_registry; | ||
use prometheus::register_int_gauge_with_registry; | ||
use prometheus::IntCounter; | ||
use prometheus::IntGauge; | ||
use prometheus::Registry; | ||
use prometheus::{register_histogram_with_registry, register_int_counter_with_registry, Histogram}; | ||
use std::collections::VecDeque; | ||
use std::sync::atomic::AtomicU64; | ||
use std::sync::atomic::Ordering; | ||
|
@@ -71,8 +71,9 @@ pub struct ConsensusAdapterMetrics { | |
pub sequencing_certificate_success: IntCounter, | ||
pub sequencing_certificate_timeouts: IntCounter, | ||
pub sequencing_certificate_control_delay: IntGauge, | ||
pub sequencing_certificate_latency: Histogram, | ||
|
||
// Certificate sequencing metrics | ||
// Fragment sequencing metrics | ||
pub sequencing_fragment_attempt: IntCounter, | ||
pub sequencing_fragment_success: IntCounter, | ||
pub sequencing_fragment_timeouts: IntCounter, | ||
|
@@ -113,6 +114,12 @@ impl ConsensusAdapterMetrics { | |
registry, | ||
) | ||
.unwrap(), | ||
sequencing_certificate_latency: register_histogram_with_registry!( | ||
"sequencing_certificate_latency", | ||
"The latency for certificate sequencing.", | ||
registry, | ||
) | ||
.unwrap(), | ||
sequencing_fragment_attempt: register_int_counter_with_registry!( | ||
"sequencing_fragment_attempt", | ||
"Counts the number of sequenced fragments submitted.", | ||
|
@@ -351,6 +358,9 @@ impl ConsensusAdapter { | |
metrics | ||
.sequencing_certificate_control_delay | ||
.set(new_delay as i64); | ||
metrics | ||
.sequencing_certificate_latency | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't past just the amount of time to send a transaction to consensus? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (replied to Lu below) |
||
.observe(past_ms as f64); | ||
Comment on lines
+361
to
+363
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I noticed that metric after I added mine. There is slight difference between them(one is pure consensus vs another adds some crypto checks), so I think we can keep both. |
||
}); | ||
|
||
self.delay_ms.store(new_delay, Ordering::Relaxed); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should define buckets here until #4601 is merged (I will try to read today), the default values won't tell us much useful insight
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. Let's see if we can merge better histograms today, if not i'll make PR with better buckets [this one got merged via automerge]