Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ping-Tower / State Elevator

Part of the Ping-Tower uptime monitoring system. 📖 Full project description and architecture →

Status lifecycle worker. Evaluates each ping result against failure and latency thresholds, tracks per-server state in Redis, and publishes status transitions (updown) for the API to pick up.

Stack

C# / .NET Worker Service (net10.0), layered Domain → Application → Infrastructure, RabbitMQ.Client, StackExchange.Redis

Role in the system

q.state-elevator.server-events ──▶ [ State Elevator ] ◀── q.state-elevator.ping-events
       (server config)                    │
                                     Redis (consecutive
                                     failures, current
                                     status; TTL = 3× interval)
                                           │
                                           ▼
                              statusEventsExchange ──▶ q.api.status-events
  • Consumes server config snapshots from serverEventsExchange and raw ping results from pingEventsExchange.
  • Checks each result against FailureThreshold / LatencyThresholdMs; Redis holds consecutive-failure counts and current status per server (key prefix state-elevator:, state TTL = 3× the ping interval).
  • On a state change, publishes to statusEventsExchange with routing key server.status.changed, consumed by the API (which updates PostgreSQL and pushes the update to the frontend via SignalR).

Running locally

cp .env.example .env
docker compose up --build

Key environment variables (.env.example): STATE_ELEVATOR_RABBITMQ_* (broker connection, exchange/queue names, status routing key), STATE_ELEVATOR_REDIS_* (connection, database index, key prefix).

Tests

dotnet test src/tests/UnitTests
dotnet test src/tests/IntegrationTests

CI/CD (GitLab)

.gitlab-ci.yml: build (Docker image, push, main/stage only) → deploy (SSH, docker compose pull && up -d).

About

Status lifecycle worker for PingTower - evaluates ping results against thresholds, tracks state in Redis, publishes up/down transitions.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages