From c03f6339d3233d3a8477524e7fb8c7b3ed1c57bf Mon Sep 17 00:00:00 2001 From: Brice Dobry Date: Mon, 27 Jan 2025 17:31:18 -0500 Subject: [PATCH] chore: add percentages to log as well --- testnet/stacks-node/src/nakamoto_node/stackerdb_listener.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/testnet/stacks-node/src/nakamoto_node/stackerdb_listener.rs b/testnet/stacks-node/src/nakamoto_node/stackerdb_listener.rs index e0419b52f1..68a8af3b92 100644 --- a/testnet/stacks-node/src/nakamoto_node/stackerdb_listener.rs +++ b/testnet/stacks-node/src/nakamoto_node/stackerdb_listener.rs @@ -313,7 +313,9 @@ impl StackerDBListener { "signature" => %signature, "signer_weight" => signer_entry.weight, "total_weight_approved" => block.total_weight_approved, + "percent_approved" => block.total_weight_approved as f64 / self.total_weight as f64 * 100.0, "total_weight_rejected" => block.total_weight_rejected, + "percent_rejected" => block.total_weight_rejected as f64 / self.total_weight as f64 * 100.0, ); continue; } @@ -332,7 +334,9 @@ impl StackerDBListener { "signature" => %signature, "signer_weight" => signer_entry.weight, "total_weight_approved" => block.total_weight_approved, + "percent_approved" => block.total_weight_approved as f64 / self.total_weight as f64 * 100.0, "total_weight_rejected" => block.total_weight_rejected, + "percent_rejected" => block.total_weight_rejected as f64 / self.total_weight as f64 * 100.0, "weight_threshold" => self.weight_threshold, "tenure_extend_timestamp" => tenure_extend_timestamp, "server_version" => metadata.server_version, @@ -393,7 +397,9 @@ impl StackerDBListener { "signature" => %rejected_data.signature, "signer_weight" => signer_entry.weight, "total_weight_approved" => block.total_weight_approved, + "percent_approved" => block.total_weight_approved as f64 / self.total_weight as f64 * 100.0, "total_weight_rejected" => block.total_weight_rejected, + "percent_rejected" => block.total_weight_rejected as f64 / self.total_weight as f64 * 100.0, "weight_threshold" => self.weight_threshold, "reason" => rejected_data.reason, "reason_code" => %rejected_data.reason_code,