Files
codex/codex-rs/memories/write/src/metrics.rs
T
jif 6500c1f844 Record memory storage size after successful consolidation (#45956)
## What changed

Emit a `codex.memory.storage_bytes` histogram after successful phase-two consolidation, including runs with no workspace changes. Sum regular-file sizes recursively from filesystem metadata, excluding `.git` entries and symbolic links. Stop the phase-two duration timer before measuring storage.

## Testing

Add coverage for both memory versions, nested files, UTF-8 byte counts, Git metadata exclusion, and Unix symbolic links, including broken links and directory loops. Extend the workspace baseline reset test to verify the remaining storage size.

GitOrigin-RevId: 9170c34d656728897790decd2e2cabb38a81836f
2026-09-16 14:49:24 +00:00

13 lines
774 B
Rust

pub(crate) const MEMORY_STARTUP: &str = "codex.memory.startup";
pub(crate) const MEMORY_STORAGE_BYTES: &str = "codex.memory.storage_bytes";
pub(crate) const MEMORY_PHASE_ONE_JOBS: &str = "codex.memory.phase1";
pub(crate) const MEMORY_PHASE_ONE_E2E_MS: &str = "codex.memory.phase1.e2e_ms";
pub(crate) const MEMORY_PHASE_ONE_OUTPUT: &str = "codex.memory.phase1.output";
pub(crate) const MEMORY_PHASE_ONE_TOKEN_USAGE: &str = "codex.memory.phase1.token_usage";
pub(crate) const MEMORY_PHASE_TWO_JOBS: &str = "codex.memory.phase2";
pub(crate) const MEMORY_PHASE_TWO_E2E_MS: &str = "codex.memory.phase2.e2e_ms";
pub(crate) const MEMORY_PHASE_TWO_INPUT: &str = "codex.memory.phase2.input";
pub(crate) const MEMORY_PHASE_TWO_TOKEN_USAGE: &str = "codex.memory.phase2.token_usage";