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

remove batch_info_request_start_seq and add follower_start_seq_num #4501

Merged
merged 1 commit into from
Sep 6, 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
13 changes: 12 additions & 1 deletion crates/sui-core/src/authority.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use narwhal_executor::ExecutionStateError;
use narwhal_executor::{ExecutionIndices, ExecutionState};
use parking_lot::Mutex;
use prometheus::{
register_histogram_with_registry, register_int_counter_with_registry,
exponential_buckets, register_histogram_with_registry, register_int_counter_with_registry,
register_int_gauge_with_registry, Histogram, IntCounter, IntGauge,
};
use std::ops::Deref;
Expand Down Expand Up @@ -128,6 +128,7 @@ pub struct AuthorityMetrics {
pub follower_items_loaded: IntCounter,
pub follower_connections: IntCounter,
pub follower_connections_concurrent: IntGauge,
pub follower_start_seq_num: Histogram,

// TODO: consolidate these into GossipMetrics
// (issue: https://github.com/MystenLabs/sui/issues/3926)
Expand All @@ -144,6 +145,9 @@ const POSITIVE_INT_BUCKETS: &[f64] = &[

impl AuthorityMetrics {
pub fn new(registry: &prometheus::Registry) -> AuthorityMetrics {
// buckets are: 100, 10k, 1M, 100M, 10B, 1T, 100T, 10Q
// Safe to unwarp because the values are all valid.
let follower_seq_num_buckets = exponential_buckets(100., 100., 8).unwrap();
Self {
tx_orders: register_int_counter_with_registry!(
"total_transaction_orders",
Expand Down Expand Up @@ -245,6 +249,13 @@ impl AuthorityMetrics {
registry,
)
.unwrap(),
follower_start_seq_num: register_histogram_with_registry!(
"follower_start_seq_num",
"The start seq number this validator receives from fullnodes node_sync/follower process",
follower_seq_num_buckets,
registry,
)
.unwrap(),
gossip_queued_count: register_int_counter_with_registry!(
"gossip_queued_count",
"Number of digests queued from gossip peers",
Expand Down
4 changes: 4 additions & 0 deletions crates/sui-core/src/authority_batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,10 @@ impl crate::authority::AuthorityState {
metrics.follower_connections_concurrent.dec();
});

metrics
.follower_start_seq_num
.observe(request.start.unwrap_or(0) as f64);

// Register a subscriber to not miss any updates
let subscriber = self.subscribe_batch();

Expand Down
12 changes: 0 additions & 12 deletions crates/sui-core/src/authority_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,6 @@ impl AuthorityAPI for NetworkAuthorityClient {
&self,
request: BatchInfoRequest,
) -> Result<BatchInfoResponseItemStream, SuiError> {
self.metrics
.batch_info_request_start_seq
.observe(request.start.unwrap_or(0) as f64);

let stream = self
.client()
.batch_info(request)
Expand Down Expand Up @@ -490,8 +486,6 @@ pub struct NetworkAuthorityClientMetrics {
pub handle_object_info_request_latency: Histogram,
pub handle_transaction_info_request_latency: Histogram,
pub handle_checkpoint_request_latency: Histogram,

pub batch_info_request_start_seq: Histogram,
}

impl NetworkAuthorityClientMetrics {
Expand Down Expand Up @@ -533,12 +527,6 @@ impl NetworkAuthorityClientMetrics {
registry
)
.unwrap(),
batch_info_request_start_seq: register_histogram_with_registry!(
"batch_info_request_start_seq",
"The start sequences of the batch info requests",
registry
)
.unwrap(),
}
}

Expand Down