mirror of
https://github.com/openai/codex.git
synced 2026-11-13 22:47:20 +00:00
Expose app-server diagnostics through the experimental API (#37470)
## What changed - Add the experimental `server/diagnostics` request, returning the app-server process ID, resident memory, platform-dependent physical footprint, and registered diagnostic gauges. - Export the new protocol types in the generated JSON and TypeScript schemas and document the request. ## Testing - Verify the response includes process measurements and the registered live-thread gauge. - Verify the request is rejected unless `capabilities.experimentalApi` is enabled. GitOrigin-RevId: 099d60a9c421a74ff1a72fe524e0dfeb89cf1057
This commit is contained in:
1 parent
b3278e96cb
commit
5729546839
18 files changed
+298
No files matched your search
@@ -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