Define the Operation Before Timing It

A timing report needs to state what work starts and ends the observation. Seemingly similar measurements can cover different stages.

Source
Anbloq
Language
English
Created
Updated
Chapters
4
Reading time
1 min
In this article4 chapters
  1. Trace a file export
  2. Choose a consumer-relevant metric
  3. Choose explicit start and finish events
  4. Record the work included outside the measured operation

Trace a file export

Timing only serialization excludes input parsing and filesystem publication. Timing the whole command includes them. Program boundaries identify the meaningful stages.

Choose a consumer-relevant metric

If users wait until their export is readable, measure that interval. Record any additional component timings for diagnosis. A service release check illustrates observing an outcome at the point where it matters.[1]

Choose explicit start and finish events

A report takes six milliseconds to render from prepared rows and thirty milliseconds from request arrival through response. Both can be measured but they describe different operations. Start before data retrieval when the goal is the time a reader waits. See end-to-end request timing.

A: render start → complete HTML, 6 ms
B: request arrives → response complete, 30 ms
Both observations require an explicitly named boundary

Record the work included outside the measured operation

Startup, file setup and retries can be paid once or on every request. Define whether each cost belongs in the reported number. Test one empty and one realistic result.

References

  1. Google, Site Reliability Engineering ↩