Skip to content

Commit 5281abc

Browse files
authored
Merge pull request #423 from yungwine/prometheus
make celldb_gc_state metric -1 if last_deleted_mc_state is 0
2 parents d97e401 + 69f3550 commit 5281abc

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

modules/prometheus.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,11 @@ def get_validator_status_metrics(self, result: list):
4848
result.append(METRICS['out_of_ser'].to_format(status.masterchain_out_of_ser))
4949
if status.masterchainblock is not None and status.gcmasterchainblock is not None:
5050
result.append(METRICS['celldb_gc_block'].to_format(status.masterchainblock - status.gcmasterchainblock))
51-
if status.gcmasterchainblock is not None and status.last_deleted_mc_state is not None and status.last_deleted_mc_state != 0:
52-
result.append(METRICS['celldb_gc_state'].to_format(status.gcmasterchainblock - status.last_deleted_mc_state))
51+
if status.gcmasterchainblock is not None and status.last_deleted_mc_state is not None:
52+
if status.last_deleted_mc_state != 0:
53+
result.append(METRICS['celldb_gc_state'].to_format(status.gcmasterchainblock - status.last_deleted_mc_state))
54+
else:
55+
result.append(METRICS['celldb_gc_state'].to_format(-1))
5356
result.append(METRICS['vc_up'].to_format(int(is_working)))
5457

5558
def get_validator_validation_metrics(self, result: list):

0 commit comments

Comments
 (0)