fix metrics
@@ -2711,10 +2711,17 @@ class Node(HasActionQueue, Motor, Propagator, MessageProcessor, HasFileStorage,
def sum_for_backups(field):
return sum(len(getattr(r, field)) for r in self.replicas._replicas.values() if r is not self.master_replica)
+ def sum_for_backups_data(field):
+ return sum(len(getattr(r._consensus_data, field)) for r in self.replicas._replicas.values() if r is not self.master_replica)
+
def sum_for_values_for_backups(field):
return sum(sum_for_values(getattr(r, field))
for r in self.replicas._replicas.values() if r is not self.master_replica)
+ def sum_for_values_for_backups_checkpointer(field):
+ return sum(sum_for_values(getattr(r._checkpointer, field))
+ for r in self.replicas._replicas.values() if r is not self.master_replica)
+
self.metrics.add_event(MetricsName.REPLICA_OUTBOX_BACKUP, sum_for_backups('outBox'))
self.metrics.add_event(MetricsName.REPLICA_INBOX_BACKUP, sum_for_backups('inBox'))
self.metrics.add_event(MetricsName.REPLICA_INBOX_STASH_BACKUP, sum_for_backups('inBoxStash'))
@@ -2733,9 +2740,9 @@ class Node(HasActionQueue, Motor, Propagator, MessageProcessor, HasFileStorage,
self.metrics.add_event(MetricsName.REPLICA_PRIMARYNAMES_BACKUP, sum_for_backups('primaryNames'))
self.metrics.add_event(MetricsName.REPLICA_STASHED_OUT_OF_ORDER_COMMITS_BACKUP,
sum_for_values_for_backups('stashed_out_of_order_commits'))
- self.metrics.add_event(MetricsName.REPLICA_CHECKPOINTS_BACKUP, sum_for_backups('checkpoints'))
+ self.metrics.add_event(MetricsName.REPLICA_CHECKPOINTS_BACKUP, sum_for_backups_data('checkpoints'))
self.metrics.add_event(MetricsName.REPLICA_STASHED_RECVD_CHECKPOINTS_BACKUP,
- sum_for_values_for_backups('stashed_recvd_checkpoints'))
+ sum_for_values_for_backups_checkpointer('_stashed_recvd_checkpoints'))
self.metrics.add_event(MetricsName.REPLICA_STASHING_WHILE_OUTSIDE_WATERMARKS_BACKUP,
sum(r.stasher.num_stashed_watermarks for r in self.replicas.values()))
self.metrics.add_event(MetricsName.REPLICA_REQUEST_QUEUES_BACKUP,
