Skip to main content

Module perf_log

Module perf_log 

Source
Expand description

The web page’s perf log: the frame records a client with no shell measures, written beside forge.log.

The page owns the measurement (client/src/perf.ts); a shell writes it through its own invoke and a page sends the same batches over the socket. Records arrive as the page serialised them and leave as one JSON line each, under the log’s own size cap with a single rolled copy - the log is read after the fact, and the newest window is what a reader wants.

Re-exports§

use std::io::Write as _; 🔒
use std::path::Path; 🔒
use std::sync::Mutex; 🔒
use std::sync::MutexGuard; 🔒
use crate::logging::LOG_ROTATION_MAX_BYTES; 🔒
use crate::logging::RollingFileWriter; 🔒
use crate::logging::default_diagnostics_dir; 🔒

Constants§

PERF_LOG_NAME 🔒
Where the web client’s perf log sits beside the server’s own forge.log.
PERF_ROTATION_FILES 🔒
One rolled copy, as the shell’s sink keeps.

Statics§

WRITE 🔒
One append at a time.

Functions§

append 🔒
Append one batch to the web client’s perf log.
append_in 🔒
The write itself, over a directory and a cap a test can hand it.
write_guard 🔒