Skip to main content

Module StatusReporter

Module StatusReporter 

Source
Expand description

Status and metrics reporting (atomized; siblings live in StatusReporter/).

§IPC Status Reporter

Mountain-side observability for the Wind ↔ Mountain bridge. Collects per-channel message counters, latency, queue depth, and host resource samples; aggregates them into health-score and service-discovery snapshots; emits to Sky via Tauri events on a configurable interval.

Layout:

  • DTO siblings (Struct / Enum per file): the wire shapes Sky deserialises.
  • Reporter::Struct - the aggregator + 30-method impl (one cohesive unit; constructor, periodic loops, health check, service discovery, recovery).
  • mountain_* Tauri commands - one wire-bound entry per file, all delegating to the Reporter::Struct in Tauri state.
  • InitializeStatusReporter::initialize_status_reporter - bootstrap helper called from Binary/Register/StatusReporterRegister.rs.

Modules§

ComprehensiveStatusReport
Combined status report - basic IPC slice + performance metrics + health monitor - emitted to Sky periodically and returned by mountain_get_comprehensive_status.
ConnectionStatus
Connectivity slice of IPCStatusReport::Struct - is the IPC server reachable, when did it last heartbeat, and how long has the current connection been alive.
HealthIssue
Single health-check finding: what went wrong, how serious, when detected, and (optionally) when resolved. Carried in HealthMonitor::Struct::issues_detected.
HealthIssueType
Discriminator for HealthIssue::Struct - the kind of anomaly the reporter detected during a health check.
HealthMonitor
Aggregated health snapshot - 0-100 score plus the list of HealthIssue::Struct entries that drove the deductions, and a counter for automatic-recovery attempts.
IPCStatusReport
Single-tick IPC status report sent to Sky: connection state, queue depth, listener inventory, recent message stats, error count, uptime.
InitializeStatusReporter
Bootstrap helper - construct the StatusReporter::Reporter and stash a clone in the app’s Tauri state so the mountain_* Tauri commands can try_state::<Reporter>().
MessageStats
Per-channel message counters used to compute throughput and average processing time inside IPCStatusReport::Struct.
PerformanceMetrics
Sliding-window IPC performance snapshot - throughput, latency, compression ratio, pool utilization, plus host resource samples.
Reporter
StatusReporter aggregator - holds the IPC server handle, status history ring (last 100), error counter, performance / health / service-registry shared state, and emits periodic snapshots to Sky.
ServiceInfo
Single-service descriptor produced by service discovery. Carries identity, status, lifecycle timings, dependency list, performance counters, and the gRPC endpoint.
ServiceMetrics
Per-service performance counters embedded inside ServiceInfo::Struct. Currently filled with mock values pending real metric plumbing.
ServiceRegistry
Service-discovery registry - the map of known services and the schedule on which discovery refreshes it.
ServiceStatus
Lifecycle state of a discovered Mountain service.
SeverityLevel
Severity rating attached to a HealthIssue::Struct. Drives whether the alert is informational (Low) or pages on-call (Critical).
mountain_attempt_recovery
mountain_attempt_recovery Tauri command - dispose + reinitialise the IPC server and zero the error counter.
mountain_discover_services
mountain_discover_services Tauri command - run a one-shot discovery pass and return the populated ServiceInfo::Struct list.
mountain_get_comprehensive_status
mountain_get_comprehensive_status Tauri command - assembles a ComprehensiveStatusReport::Struct (basic status + performance metrics + health) in one call.
mountain_get_health_status
mountain_get_health_status Tauri command - returns the current HealthMonitor::Struct (score + active issues).
mountain_get_ipc_status
mountain_get_ipc_status Tauri command - one-shot status report (basic IPC slice only).
mountain_get_ipc_status_history
mountain_get_ipc_status_history Tauri command - returns the last-100 ring buffer of IPCStatusReport::Struct.
mountain_get_performance_metrics
mountain_get_performance_metrics Tauri command - returns the latest cached PerformanceMetrics::Struct snapshot.
mountain_get_service_info
mountain_get_service_info Tauri command - look up one service by name in the registry.
mountain_get_service_registry
mountain_get_service_registry Tauri command - returns the full ServiceRegistry::Struct snapshot.
mountain_perform_health_check
mountain_perform_health_check Tauri command - runs a synchronous health-check pass and returns the resulting HealthMonitor::Struct.
mountain_start_ipc_status_reporting
mountain_start_ipc_status_reporting Tauri command - kick off the periodic Sky-emit loop with interval_seconds between snapshots.
mountain_start_service_discovery
mountain_start_service_discovery Tauri command - kicks off the periodic service-discovery background task driven by ServiceRegistry::Struct::discovery_interval.