Skip to content

Commit

Permalink
chore: add percentages to log as well
Browse files Browse the repository at this point in the history
  • Loading branch information
obycode committed Jan 28, 2025
1 parent aa9752f commit c03f633
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions testnet/stacks-node/src/nakamoto_node/stackerdb_listener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit c03f633

Please sign in to comment.