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

Improve QS backpressure counter #13998

Merged
merged 1 commit into from
Jul 16, 2024
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
6 changes: 5 additions & 1 deletion consensus/src/quorum_store/batch_generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,7 @@ impl BatchGenerator {
trace!("QS: dynamic_max_pull_txn_per_s: {}", dynamic_pull_txn_per_s);
}
counters::QS_BACKPRESSURE_TXN_COUNT.observe(1.0);
counters::QS_BACKPRESSURE_MAKE_STRICTER_TXN_COUNT.observe(1.0);
counters::QS_BACKPRESSURE_DYNAMIC_MAX.observe(dynamic_pull_txn_per_s as f64);
} else {
// additive increase, every second
Expand All @@ -436,7 +437,10 @@ impl BatchGenerator {
);
trace!("QS: dynamic_max_pull_txn_per_s: {}", dynamic_pull_txn_per_s);
}
counters::QS_BACKPRESSURE_TXN_COUNT.observe(0.0);
counters::QS_BACKPRESSURE_TXN_COUNT.observe(
if dynamic_pull_txn_per_s < self.config.back_pressure.dynamic_max_txn_per_s { 1.0 } else { 0.0 }
);
counters::QS_BACKPRESSURE_MAKE_STRICTER_TXN_COUNT.observe(0.0);
counters::QS_BACKPRESSURE_DYNAMIC_MAX.observe(dynamic_pull_txn_per_s as f64);
}
if self.back_pressure.proof_count {
Expand Down
7 changes: 7 additions & 0 deletions consensus/src/quorum_store/counters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,13 @@ pub static QS_BACKPRESSURE_TXN_COUNT: Lazy<Histogram> = Lazy::new(|| {
)
});

pub static QS_BACKPRESSURE_MAKE_STRICTER_TXN_COUNT: Lazy<Histogram> = Lazy::new(|| {
register_avg_counter(
"quorum_store_backpressure_make_stricter_txn_count",
"Indicator of whether Quorum Store txn count backpressure is being made stricter.",
)
});

pub static QS_BACKPRESSURE_PROOF_COUNT: Lazy<Histogram> = Lazy::new(|| {
register_avg_counter(
"quorum_store_backpressure_proof_count",
Expand Down
Loading