Skip to content

Commit

Permalink
log capacity info
Browse files Browse the repository at this point in the history
  • Loading branch information
vovkman committed Aug 28, 2024
1 parent 6a4a572 commit af8de25
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions rpc/src/rpc_subscriptions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -757,6 +757,18 @@ impl RpcSubscriptions {

fn enqueue_notification(&self, notification_entry: NotificationEntry) {
if let Some(ref notification_sender) = self.notification_sender {
let queue_size = notification_sender.len();
let max_capacity = notification_sender.capacity();
datapoint_info!(
"rpc_pubsub_queue",
("size", queue_size, i64),
(
"remaining_capacity",
max_capacity.unwrap_or(usize::MAX) - queue_size,
i64
)
);

match notification_sender.send(notification_entry.into()) {
Ok(()) => (),
Err(SendError(notification)) => {
Expand Down

0 comments on commit af8de25

Please sign in to comment.