Skip to content

Commit

Permalink
fix: cope with inboundGovernor metrics missing
Browse files Browse the repository at this point in the history
  • Loading branch information
oversize committed Oct 17, 2024
1 parent 74de66e commit 6bd4396
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/blockperf/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,12 @@ def mqtt_payload_from(self, sample: BlockSample) -> dict:
if endpoint := self.app_config.prometheus_endpoint:
metrics = self.prometheus_metrics(endpoint)
if metrics:
payload["inboundGovernor_hot"] = int(
metrics.get("cardano_node_metrics_inboundGovernor_hot")
)
payload["inboundGovernor_warm"] = int(
metrics.get("cardano_node_metrics_inboundGovernor_warm")
)
hot = metrics.get("cardano_node_metrics_inboundGovernor_hot")
if hot:
payload["inboundGovernor_hot"] = int(hot)
warm = metrics.get("cardano_node_metrics_inboundGovernor_warm")
if warm:
payload["inboundGovernor_warm"] = int(warm)
return payload

def ensure_maxblocks(self):
Expand Down

0 comments on commit 6bd4396

Please sign in to comment.