From 490ea17274514acc4541b848b825a0d5f04378b5 Mon Sep 17 00:00:00 2001 From: kogeler Date: Tue, 23 Jul 2024 13:18:28 +0300 Subject: [PATCH] and block rate feature to the ws_health_exporter role --- roles/ws_health_exporter/defaults/main.yml | 6 ++++-- roles/ws_health_exporter/templates/.service.j2 | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/roles/ws_health_exporter/defaults/main.yml b/roles/ws_health_exporter/defaults/main.yml index ee432ca..f133b1f 100644 --- a/roles/ws_health_exporter/defaults/main.yml +++ b/roles/ws_health_exporter/defaults/main.yml @@ -12,8 +12,10 @@ ws_health_exporter_port: 8001 ws_health_exporter_log_level: INFO ws_health_exporter_ws_check_interval: 10 ws_health_exporter_ws_timeout: 60 -ws_health_exporter_node_max_unsynchronized_block_drift: 0 -ws_health_exporter_node_min_peers: 10 +ws_health_exporter_node_max_unsynchronized_block_drift: 0 # blocks, 0 - disabled +ws_health_exporter_node_min_peers: 10 # peers +ws_health_exporter_min_block_rate: 0.0 # blocks/second, 0.0 - disabled +ws_health_exporter_block_rate_measurement_period: 600 # seconds ws_health_exporter_ws_urls: - ws://127.0.0.1:9944 diff --git a/roles/ws_health_exporter/templates/.service.j2 b/roles/ws_health_exporter/templates/.service.j2 index 5003cbf..a70368f 100644 --- a/roles/ws_health_exporter/templates/.service.j2 +++ b/roles/ws_health_exporter/templates/.service.j2 @@ -11,6 +11,8 @@ Environment="WSHE_WS_CHECK_INTERVAL={{ ws_health_exporter_ws_check_interval }}" Environment="WSHE_WS_TIMEOUT={{ ws_health_exporter_ws_timeout }}" Environment="WSHE_NODE_MAX_UNSYNCHRONIZED_BLOCK_DRIFT={{ ws_health_exporter_node_max_unsynchronized_block_drift }}" Environment="WSHE_NODE_MIN_PEERS={{ ws_health_exporter_node_min_peers }}" +Environment="WSHE_MIN_BLOCK_RATE={{ ws_health_exporter_min_block_rate }}" +Environment="WSHE_BLOCK_RATE_MEASUREMENT_PERIOD={{ ws_health_exporter_block_rate_measurement_period }}" ExecStart={{ _ws_health_exporter_venv }}/bin/python3 {{ _ws_health_exporter_file }}