Skip to content

Commit c03f633

Browse files
committed
chore: add percentages to log as well
1 parent aa9752f commit c03f633

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

testnet/stacks-node/src/nakamoto_node/stackerdb_listener.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,9 @@ impl StackerDBListener {
313313
"signature" => %signature,
314314
"signer_weight" => signer_entry.weight,
315315
"total_weight_approved" => block.total_weight_approved,
316+
"percent_approved" => block.total_weight_approved as f64 / self.total_weight as f64 * 100.0,
316317
"total_weight_rejected" => block.total_weight_rejected,
318+
"percent_rejected" => block.total_weight_rejected as f64 / self.total_weight as f64 * 100.0,
317319
);
318320
continue;
319321
}
@@ -332,7 +334,9 @@ impl StackerDBListener {
332334
"signature" => %signature,
333335
"signer_weight" => signer_entry.weight,
334336
"total_weight_approved" => block.total_weight_approved,
337+
"percent_approved" => block.total_weight_approved as f64 / self.total_weight as f64 * 100.0,
335338
"total_weight_rejected" => block.total_weight_rejected,
339+
"percent_rejected" => block.total_weight_rejected as f64 / self.total_weight as f64 * 100.0,
336340
"weight_threshold" => self.weight_threshold,
337341
"tenure_extend_timestamp" => tenure_extend_timestamp,
338342
"server_version" => metadata.server_version,
@@ -393,7 +397,9 @@ impl StackerDBListener {
393397
"signature" => %rejected_data.signature,
394398
"signer_weight" => signer_entry.weight,
395399
"total_weight_approved" => block.total_weight_approved,
400+
"percent_approved" => block.total_weight_approved as f64 / self.total_weight as f64 * 100.0,
396401
"total_weight_rejected" => block.total_weight_rejected,
402+
"percent_rejected" => block.total_weight_rejected as f64 / self.total_weight as f64 * 100.0,
397403
"weight_threshold" => self.weight_threshold,
398404
"reason" => rejected_data.reason,
399405
"reason_code" => %rejected_data.reason_code,

0 commit comments

Comments
 (0)