-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Several metrics changes #5123
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
Open
ndr-ds
wants to merge
1
commit into
11-28-make_notification_and_cross_chain_queue_sizes_grow_with_network_size
Choose a base branch
from
11-28-several_metrics_changes
base: 11-28-make_notification_and_cross_chain_queue_sizes_grow_with_network_size
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+256
−45
Open
Several metrics changes #5123
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -64,9 +64,9 @@ mod metrics { | |
|
|
||
| use linera_base::prometheus_util::{ | ||
| exponential_bucket_interval, register_histogram_vec, register_int_counter, | ||
| register_int_counter_vec, | ||
| register_int_counter_vec, register_int_gauge, | ||
| }; | ||
| use prometheus::{HistogramVec, IntCounter, IntCounterVec}; | ||
| use prometheus::{HistogramVec, IntCounter, IntCounterVec, IntGauge}; | ||
|
|
||
| pub static NUM_ROUNDS_IN_CERTIFICATE: LazyLock<HistogramVec> = LazyLock::new(|| { | ||
| register_histogram_vec( | ||
|
|
@@ -92,6 +92,9 @@ mod metrics { | |
| pub static INCOMING_BUNDLE_COUNT: LazyLock<IntCounter> = | ||
| LazyLock::new(|| register_int_counter("incoming_bundle_count", "Incoming bundle count")); | ||
|
|
||
| pub static INCOMING_MESSAGE_COUNT: LazyLock<IntCounter> = | ||
| LazyLock::new(|| register_int_counter("incoming_message_count", "Incoming message count")); | ||
|
|
||
| pub static OPERATION_COUNT: LazyLock<IntCounter> = | ||
| LazyLock::new(|| register_int_counter("operation_count", "Operation count")); | ||
|
|
||
|
|
@@ -113,6 +116,14 @@ mod metrics { | |
| "Number of chain info queries processed", | ||
| ) | ||
| }); | ||
|
|
||
| /// Number of cached chain worker channel endpoints in the BTreeMap. | ||
| pub static CHAIN_WORKER_ENDPOINTS_CACHED: LazyLock<IntGauge> = LazyLock::new(|| { | ||
| register_int_gauge( | ||
| "chain_worker_endpoints_cached", | ||
| "Number of cached chain worker channel endpoints", | ||
| ) | ||
| }); | ||
| } | ||
|
|
||
| /// Instruct the networking layer to send cross-chain requests and/or push notifications. | ||
|
|
@@ -934,6 +945,8 @@ where | |
|
|
||
| // Put back the sender in the cache for next time. | ||
| chain_workers.insert(chain_id, sender); | ||
| #[cfg(with_metrics)] | ||
| metrics::CHAIN_WORKER_ENDPOINTS_CACHED.set(chain_workers.len() as i64); | ||
|
Contributor
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. Will this decrement properly as chain workers are removed from the cache? i.e. is this the only place where workers are being evicted? Or can they be also dropped elsewhere (and we'd get outdated values in metrics). |
||
|
|
||
| Ok(new_channel) | ||
| } | ||
|
|
@@ -1011,6 +1024,12 @@ where | |
| certificate.round.number(), | ||
| certificate.block().body.transactions.len() as u64, | ||
| certificate.block().body.incoming_bundles().count() as u64, | ||
| certificate | ||
| .block() | ||
| .body | ||
| .incoming_bundles() | ||
| .map(|b| b.messages().count()) | ||
| .sum::<usize>() as u64, | ||
| certificate.block().body.operations().count() as u64, | ||
| certificate | ||
| .signatures() | ||
|
|
@@ -1032,6 +1051,7 @@ where | |
| round_number, | ||
| confirmed_transactions, | ||
| confirmed_incoming_bundles, | ||
| confirmed_incoming_messages, | ||
| confirmed_operations, | ||
| validators_with_signatures, | ||
| ) = metrics_data; | ||
|
|
@@ -1046,6 +1066,9 @@ where | |
| if confirmed_incoming_bundles > 0 { | ||
| metrics::INCOMING_BUNDLE_COUNT.inc_by(confirmed_incoming_bundles); | ||
| } | ||
| if confirmed_incoming_messages > 0 { | ||
| metrics::INCOMING_MESSAGE_COUNT.inc_by(confirmed_incoming_messages); | ||
| } | ||
| if confirmed_operations > 0 { | ||
| metrics::OPERATION_COUNT.inc_by(confirmed_operations); | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
(or: "in the map"?)