pulse-lets-go/CHANGELOG.md
Maksim Totmin b0697da8e4 feat: weighted random routing + mode switching + EWMA smoothing + stale eviction
- Weighted random routing (math/rand/v2 per-goroutine ChaCha8)
- PUT /api/route/mode for runtime mode switch (best / weighted_random)
- EWMA score smoothing (configurable smoothing_factor, default 0.3)
- Periodic stale node eviction (5 min threshold, 60s interval)
- Non-blocking WS broadcast (per-client buffered channel + writePump)
- Background rate limiter cleanup goroutine
- In-memory trunk gateway cache (zero disk I/O in hot path)
- Configurable load_avg multiplier (default 50.0, backward compat)
- UI mode indicator + admin Switch button in dashboard
- 42 tests: weighted random, mode switching, EWMA, eviction, API integration
2026-06-25 20:42:46 +07:00

37 lines
1.4 KiB
Markdown

# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/),
and this project adheres to [Semantic Versioning](https://semver.org/).
## [0.1.0] — 2026-06-25
### Added
- NATS subscriber for `pulse.metrics.>` with JSON unmarshal
- Scoring engine with lethal checks (disabled, stale, status, capacity, CPU, failure rate)
- Weighted score formula (call 40%, load 30%, idle 20%, fail 10%)
- Best-node cache with O(1) route resolution
- REST API: `/api/route` (no auth), `/api/nodes`, `/api/trunks`, `/api/users`
- JWT authentication (access + refresh tokens) with admin/viewer roles
- Monitoring endpoints: Prometheus + Zabbix (API-key auth)
- WebSocket hub for real-time metrics streaming
- SvelteKit frontend with dashboard, node/trunk/user management
- FreeSWITCH ESL client for Sofia gateway management
- ASCII metrics logger with daily rotation
- Config manager with atomic JSON save (tmp → rename)
- Rate limiting with per-IP token buckets
- CORS middleware
- Graceful shutdown (SIGINT/SIGTERM, 10s timeout)
- systemd unit with security isolation
- NATS metrics emulator for testing (7 scenarios)
- route.lua — FreeSWITCH dialplan script
- Build system: single binary with embedded frontend (Makefile)
### Security
- Auto-generated JWT secret and monitoring API key on first run
- bcrypt password hashing
- NoNewPrivileges, ProtectSystem, PrivateTmp in systemd unit