mirror of
https://github.com/openai/codex.git
synced 2026-10-19 17:28:46 +00:00
Add process diagnostics snapshots (#37434)
## What changed - Add a `codex-diagnostics` crate that snapshots the process ID, available resident-memory measurements, and registered process-wide gauges. - Provide guards that update gauges for the lifetime of measured objects. - Track live `CodexThread` instances with the `core.threads.live` gauge. ## Testing - Add unit coverage for gauge registration, guard lifetimes, process memory snapshots, and live-thread reporting. GitOrigin-RevId: 3236b086bd4ebe31ed4768ab87a5fa288b0891b0
This commit is contained in:
@@ -800,6 +800,12 @@ async fn start_thread_keeps_internal_threads_hidden_from_normal_lookups() {
|
||||
|
||||
assert_eq!(manager.list_thread_ids().await, Vec::new());
|
||||
assert!(manager.get_thread(thread.thread_id).await.is_err());
|
||||
assert!(
|
||||
codex_diagnostics::snapshot()
|
||||
.gauges
|
||||
.iter()
|
||||
.any(|gauge| gauge.name == "core.threads.live" && gauge.value > 0)
|
||||
);
|
||||
|
||||
let report = manager
|
||||
.shutdown_all_threads_bounded(Duration::from_secs(10))
|
||||
|
||||
Reference in New Issue
Block a user