MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / health

Function health

packages/server/src/api/routes.rs:961–985  ·  view source on GitHub ↗
(State(state): State<AppState>)

Source from the content-addressed store, hash-verified

959}
960
961async fn health(State(state): State<AppState>) -> Json<Value> {
962 let video_codec = active_video_codec(&state.config);
963 let stream_quality =
964 stream_quality_state_value(&current_stream_quality_state(video_codec.clone()));
965 json(json_value!({
966 "ok": true,
967 "serverId": crate::auth::server_identity(&state.config),
968 "advertiseHost": state.config.advertise_host,
969 "hostId": state.config.host_id,
970 "hostName": state.config.host_name,
971 "httpPort": state.config.http_port,
972 "serverKind": state.config.server_kind.as_str(),
973 "timestamp": SystemTime::now().duration_since(UNIX_EPOCH).unwrap_or(Duration::ZERO).as_secs_f64(),
974 "videoCodec": video_codec,
975 "androidGpu": active_android_gpu(),
976 "lowLatency": state.config.low_latency,
977 "realtimeStream": crate::transport::webrtc::realtime_stream_enabled(),
978 "localStreamFps": env_u32("SIMDECK_LOCAL_STREAM_FPS", 60, 15, 240),
979 "streamQuality": stream_quality,
980 "webRtc": {
981 "iceServers": crate::transport::webrtc::client_ice_servers(),
982 "iceTransportPolicy": crate::transport::webrtc::ice_transport_policy_label()
983 }
984 }))
985}
986
987fn active_video_codec(config: &Config) -> String {
988 std::env::var("SIMDECK_VIDEO_CODEC")

Callers

nothing calls this directly

Calls 5

active_video_codecFunction · 0.85
jsonFunction · 0.85
cloneMethod · 0.65

Tested by

no test coverage detected