701, 'department_id' => 1, 'status' => edge_gateway_manager::STATUS_ONLINE, 'version_drift' => ['is_drifted' => true], 'channel_status' => ['broker' => ['connected' => true]], 'active_operation' => ['id' => 91, 'type' => 'DISCOVERY'], 'recent_operations_summary' => ['pending' => 1, 'in_progress' => 1], 'backlog_depth' => ['operations' => 2, 'commands' => 3], 'metadata' => [ 'system_metrics' => [ 'latency_ms' => 184, 'cpu_usage_pct' => 27, 'memory_usage_pct' => 61, 'disk_usage_pct' => 58, ], ], ], [ 'id' => 702, 'department_id' => 2, 'status' => edge_gateway_manager::STATUS_OFFLINE, 'version_drift' => ['is_drifted' => false], 'channel_status' => ['broker' => ['connected' => false]], 'active_operation' => null, 'recent_operations_summary' => ['pending' => 0, 'in_progress' => 0], 'backlog_depth' => ['operations' => 0, 'commands' => 1], 'metadata' => [ 'system_metrics' => [ 'latency_ms' => 412, 'cpu_usage_pct' => 9, 'memory_usage_pct' => 42, 'disk_usage_pct' => 76, ], ], ], ], [ 'total' => 2, 'online' => 1, 'offline' => 1, ], [ 'total' => 3, 'fallback_overrides' => 2, 'cloud_only' => 1, 'local_only' => 1, ]); expect($summary['gateways'])->toBe([ 'total' => 2, 'departments' => 2, 'online' => 1, 'offline' => 1, 'degraded' => 0, 'drifted' => 1, 'broker_connected' => 1, ]); expect($summary['inventory'])->toBe([ 'total' => 2, 'online' => 1, 'offline' => 1, ]); expect($summary['bindings'])->toBe([ 'total' => 3, 'fallback_overrides' => 2, 'cloud_only' => 1, 'local_only' => 1, ]); expect($summary['operations'])->toBe([ 'active' => 1, 'pending' => 1, 'in_progress' => 1, 'backlog' => 2, ]); expect($summary['commands'])->toBe([ 'backlog' => 4, ]); expect($summary['system'])->toBe([ 'latency_ms_avg' => 298, 'cpu_usage_pct_avg' => 18, 'memory_usage_pct_avg' => 52, 'disk_usage_pct_avg' => 67, ]); });