Base: codex-main originale (prima del fork aKode)
This commit is contained in:
23
codex-rs/app-server/src/request_processors/diagnostics.rs
Normal file
23
codex-rs/app-server/src/request_processors/diagnostics.rs
Normal file
@@ -0,0 +1,23 @@
|
||||
use codex_app_server_protocol::ServerDiagnosticsGauge;
|
||||
use codex_app_server_protocol::ServerDiagnosticsProcess;
|
||||
use codex_app_server_protocol::ServerDiagnosticsResponse;
|
||||
|
||||
pub(crate) fn read_server_diagnostics() -> ServerDiagnosticsResponse {
|
||||
let diagnostics = codex_diagnostics::snapshot();
|
||||
|
||||
ServerDiagnosticsResponse {
|
||||
process: ServerDiagnosticsProcess {
|
||||
id: diagnostics.process.id,
|
||||
resident_memory_bytes: diagnostics.process.resident_memory_bytes,
|
||||
physical_footprint_bytes: diagnostics.process.physical_footprint_bytes,
|
||||
},
|
||||
gauges: diagnostics
|
||||
.gauges
|
||||
.into_iter()
|
||||
.map(|gauge| ServerDiagnosticsGauge {
|
||||
name: gauge.name.to_string(),
|
||||
value: gauge.value,
|
||||
})
|
||||
.collect(),
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user