Skip to main content

Module service_timing

Module service_timing 

Source
Expand description

The lines the commit service writes about its life and about the time each request took. What: The lines the resident commit service writes to its log (standard error, which the service manager keeps in the journal) about its own life and about the time each request took: when it started, one line for each request it answered with the phases of the wait, a retire request, and its exit with the reason and the uptime. Why: After a slow commit the journal held ready and nothing else, so nothing said whether the time went to the queue, to another program’s hold on the index, to the landing or to a service being replaced. These lines cost one clock read per phase edge and one line per request; they name no person (the commit’s message and identities never appear) and are not shown to the person at the terminal.

In TS you’d write (pseudocode):

console.error(`cli-git-service: answered request=${id} queued_ms=${queued} lock_wait_ms=${lockWait} total_ms=${total}`);

Structs§

Answered
Everything the line for one answered request states.
Arrival
When a connection was accepted and how long its request line took to arrive.
LandTiming
What: The phases of one landing the service itself spent time in, summed over the attempts a moving branch made it repeat. Why: The wait for another program’s hold on the index, the objects, the journal write, the branch move and the index update are the stretches a slow landing can lose time in; whatever else a landing did is reported as the reads that remain.

Enums§

ExitReason
Why a service ended.

Constants§

LOG_PREFIX
The prefix of every line the service writes, which journalctl shows after the unit name.

Functions§

answered_line
What: One answered request as a line of key=value words, without the prefix. Why: Text values are written in Rust’s quoted form, which has no raw newline or unescaped quote, so the line stays one line whatever a client sent; the numbers are whole milliseconds.
exit_line
The line for the service’s own exit, with the time it ran since it began serving.
log
What: Writes one line to the service’s log. Why: Standard error is the service manager’s journal; one write carries the prefix, the line and the newline together, and a closed or broken stream is not the service’s failure.
retire_line
The line for a retire message: a client of another release found this service and asked it to finish its batch and exit.
started_line
The line a service writes as it starts, before ready: the release it announces, the protocol, its process and the worktree instance it serves.