//! Diagnostic topic definitions
//!
//! All diagnostics use the `/diagnostics` namespace for easy filtering and monitoring.

/// Base namespace for all diagnostics
pub const DIAGNOSTICS_NAMESPACE: &str = "/diagnostics";

// ===== Streaming Pipeline Topics =====

/// Streaming pipeline metrics (frames received, encoded, sent, dropped)
pub const TOPIC_DIAGNOSTICS_STREAMING_PIPELINE: &str = "/diagnostics/streaming/pipeline";

/// Streaming latency metrics (camera→bridge, encoding, network, e2e)
pub const TOPIC_DIAGNOSTICS_STREAMING_LATENCY: &str = "/diagnostics/streaming/latency";

/// Encoding performance metrics (encode times, slow frames, etc.)
pub const TOPIC_DIAGNOSTICS_STREAMING_ENCODING: &str = "/diagnostics/streaming/encoding";

/// Streaming bandwidth metrics (bitrate, throughput, etc.)
pub const TOPIC_DIAGNOSTICS_STREAMING_BANDWIDTH: &str = "/diagnostics/streaming/bandwidth";

// ===== WebRTC Topics =====

/// WebRTC connection metrics (peer count, connection state)
pub const TOPIC_DIAGNOSTICS_WEBRTC_CONNECTIONS: &str = "/diagnostics/webrtc/connections";

/// WebRTC quality metrics (RTT, packet loss, jitter)
pub const TOPIC_DIAGNOSTICS_WEBRTC_QUALITY: &str = "/diagnostics/webrtc/quality";

// ===== WebSocket Topics =====

/// WebSocket connection metrics
pub const TOPIC_DIAGNOSTICS_WEBSOCKET_CONNECTIONS: &str = "/diagnostics/websocket/connections";

/// WebSocket message metrics (rate, size, errors)
pub const TOPIC_DIAGNOSTICS_WEBSOCKET_MESSAGES: &str = "/diagnostics/websocket/messages";

// ===== Redis Topics =====

/// Redis connection pool metrics
pub const TOPIC_DIAGNOSTICS_REDIS_POOL: &str = "/diagnostics/redis/pool";

/// Redis operation metrics (latency, throughput)
pub const TOPIC_DIAGNOSTICS_REDIS_OPERATIONS: &str = "/diagnostics/redis/operations";

/// Redis server info metrics (from INFO command)
pub const TOPIC_DIAGNOSTICS_REDIS_INFO: &str = "/diagnostics/redis/info";

// ===== Docker Topics =====

/// Docker container metrics (CPU, memory, network per container)
pub const TOPIC_DIAGNOSTICS_DOCKER_CONTAINERS: &str = "/diagnostics/docker/containers";

// ===== System Topics =====

/// System-wide resource metrics (CPU, memory, disk, network)
pub const TOPIC_DIAGNOSTICS_SYSTEM_RESOURCES: &str = "/diagnostics/system/resources";

// ===== Godot Topics =====

/// Godot simulation performance metrics (FPS, frame time, physics)
pub const TOPIC_DIAGNOSTICS_GODOT_PERFORMANCE: &str = "/diagnostics/godot/performance";

/// Godot scene/node metrics (object count, memory)
pub const TOPIC_DIAGNOSTICS_GODOT_SCENE: &str = "/diagnostics/godot/scene";

/// Godot connection health (WebSocket status, reconnects)
pub const TOPIC_DIAGNOSTICS_GODOT_CONNECTION: &str = "/diagnostics/godot/connection";

// ===== Node Health Topics =====

/// Per-node health metrics (dynamic topic: /diagnostics/node/{node_id}/health)
pub fn topic_node_health(node_id: &str) -> String {
    format!("/diagnostics/node/{}/health", node_id)
}

/// All node health metrics (wildcard subscription)
pub const TOPIC_DIAGNOSTICS_NODE_HEALTH_ALL: &str = "/diagnostics/node/*/health";
