Project

lex-health

0.0
No release in over 3 years
Used to read heartbeats and updates the db
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

Runtime

 Project Readme

lex-health

Node health monitoring for LegionIO. Reads heartbeat messages from cluster nodes, updates the database with their health status, and runs a watchdog actor for detecting stale or dead nodes.

Installation

gem install lex-health

Functions

  • Health - Process incoming heartbeat messages and update node status in the database
  • Watchdog - Periodically scan for nodes with stale heartbeats and expire them to unknown status

How It Works

The Health runner receives heartbeat messages published by lex-node and upserts node records in the database. It uses timestamp comparison to prevent out-of-order updates from rolling back newer status. On each update it also marks all digital workers reported by the node as online and any workers no longer reported as unknown.

The Watchdog actor runs every 5 seconds and queries for healthy nodes whose last heartbeat timestamp is older than expire_time seconds (default: 60 seconds). Expired nodes are transitioned to unknown and all digital workers hosted on that node are marked offline.

Requirements

  • Ruby >= 3.4
  • LegionIO framework
  • legion-data (database required)

License

MIT