Skip to content

Commit

Permalink
add queue lengths to status page
Browse files Browse the repository at this point in the history
  • Loading branch information
BlinkyStitt committed Jun 7, 2023
1 parent b50579e commit 91d2883
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion web3_proxy/src/rpcs/many.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1202,7 +1202,7 @@ impl Serialize for Web3Rpcs {
where
S: Serializer,
{
let mut state = serializer.serialize_struct("Web3Rpcs", 4)?;
let mut state = serializer.serialize_struct("Web3Rpcs", 8)?;

{
let by_name = self.by_name.load();
Expand All @@ -1224,6 +1224,20 @@ impl Serialize for Web3Rpcs {

state.serialize_field("blocks_by_hash", &self.blocks_by_hash)?;
state.serialize_field("blocks_by_number", &self.blocks_by_number)?;
state.serialize_field("pending_transaction_cache", &self.pending_transaction_cache)?;

state.serialize_field("block_sender_len", &self.block_sender.len())?;

state.serialize_field(
"watch_consensus_rpcs_receivers",
&self.watch_consensus_rpcs_sender.receiver_count(),
)?;

if let Some(ref x) = self.watch_consensus_head_sender {
state.serialize_field("watch_consensus_head_receivers", &x.receiver_count())?;
} else {
state.serialize_field("watch_consensus_head_receivers", &None::<()>)?;
}

state.end()
}
Expand Down

0 comments on commit 91d2883

Please sign in to comment.