• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

gatewayd-io / gatewayd / 12458569615
60%

Build:
DEFAULT BRANCH: main
Ran 22 Dec 2024 11:31PM UTC
Jobs 1
Files 63
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

22 Dec 2024 11:28PM UTC coverage: 62.62% (+0.2%) from 62.449%
12458569615

push

github

web-flow
Add Raft Node Support for Health Checks and Metrics Collection (#643)

* Add Raft health monitoring and metrics

Add functionality to monitor Raft node health status and expose key metrics:
- Add new Prometheus metrics for Raft health status, leader status, and last contact latency
- Implement GetHealthStatus() method to track node health state
- Monitor leadership status and communication with leader
- Track last contact time with leader
- Add helper functions for metric value conversion and time parsing

The metrics will help monitor cluster health and leadership changes in production.

* feat: Integrate Raft node health checks into API

- Added Raft node dependency to `Options` and `HealthChecker` structs.
- Updated `liveness` function to include Raft node health status.
- Modified health check logic in `healthcheck.go` and `http_server.go` to consider Raft node status.
- Enhanced `healthcheck_test.go` to include tests for Raft node integration.
- Ensured Raft node is properly initialized and cleaned up in tests.

* Add TestGetHealthStatus to verify Raft node health

- Introduced a new test `TestGetHealthStatus` to check the health status of Raft nodes.
- The test covers three scenarios:
  1. When the node is the leader, it should be healthy and recognize itself as the leader.
  2. When the node is a follower, it should be healthy and recognize the leader.
  3. When no leader is available, the node should not be healthy and should report an error.
- Utilized temporary directories and a test logger for setup.
- Ensured proper shutdown of nodes after tests to prevent resource leaks.

* fix lint issues

- Corrected variable naming from `leaderId` to `leaderID` for consistency.
- Added missing periods to comments for proper punctuation.
- Used `%w` in `fmt.Errorf` for error wrapping.

* Add RaftNode to API configuration in run command

- Updated the `runCmd` in `cmd/run.go` to include `RaftNode` in the API configuration.
- This change ensures that the ... (continued)

55 of 64 new or added lines in 5 files covered. (85.94%)

5 existing lines in 1 file now uncovered.

5096 of 8138 relevant lines covered (62.62%)

17.36 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
2
80.0
-3.33% api/utils.go
7
68.07
3.13% raft/raft.go

Uncovered Existing Lines

Lines Coverage ∆ File
5
75.25
-0.83% network/server.go
Jobs
ID Job ID Ran Files Coverage
1 12458569615.1 22 Dec 2024 11:31PM UTC 63
62.62
GitHub Action Run
Source Files on build 12458569615
  • Tree
  • List 63
  • Changed 14
  • Source Changed 0
  • Coverage Changed 6
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • eec4ebaa on github
  • Prev Build on main (#12449272098)
  • Next Build on main (#12504582612)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc