mirror of
https://github.com/openai/codex.git
synced 2026-11-18 23:02:23 +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,37 @@
|
||||
use crate::JsonSchema;
|
||||
use crate::TS;
|
||||
use serde::Deserialize;
|
||||
use serde::Serialize;
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, Default, PartialEq, Eq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "v2/")]
|
||||
pub struct ServerDiagnosticsParams {}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "v2/")]
|
||||
pub struct ServerDiagnosticsResponse {
|
||||
pub process: ServerDiagnosticsProcess,
|
||||
pub gauges: Vec<ServerDiagnosticsGauge>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "v2/")]
|
||||
pub struct ServerDiagnosticsProcess {
|
||||
pub id: u32,
|
||||
#[ts(type = "number | null")]
|
||||
pub resident_memory_bytes: Option<u64>,
|
||||
#[ts(type = "number | null")]
|
||||
pub physical_footprint_bytes: Option<u64>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "v2/")]
|
||||
pub struct ServerDiagnosticsGauge {
|
||||
pub name: String,
|
||||
#[ts(type = "number")]
|
||||
pub value: u64,
|
||||
}
|
||||
Reference in new issue
Block a user