Skip to main content

Metrics and conservation

What this concept is​

Response is first execution minus arrival; turnaround is completion minus arrival. In this one-burst CPU-only model, waiting is turnaround minus service. Useful utilization counts service divided by the modeled horizon from time zero; switching and idle are not useful work.

Why it matters here​

Averages can conceal a delayed individual job. Accounting invariants detect lost work and time gaps independently of a policy preference. They are necessary evidence but cannot establish that the selected policy was followed.

Concrete example​

A(0,8), B(0,2), quantum 2 and zero overhead complete at 10 and 4. Responses are 0 and 2; turnarounds 10 and 4; waits 2 and 2. Useful service is 10, horizon is 10. FIFO completes at 8 and 10, improving A while delaying B.

Common confusion / misconception​

Completion is an absolute timestamp; turnaround is a duration. If a job arrives at 5 and finishes at 7, turnaround is 2, not 7. Also, turnaround minus CPU service is not simply ready-queue waiting once I/O blocking is introduced; this lab deliberately excludes it.

How to use it​

Independently sum run intervals by job and compare with requested service. Check every run begins at or after arrival. Check positive intervals tile the horizon and separate useful, switching and idle time. Derive first and last execution from the trace and recompute metrics rather than trusting simulator fields.

Check yourself​

For one job arriving at 5 with service 2, horizon is 7 and useful utilization is 2/7. A different denominator starting at first arrival would answer a different question. Which definition did you use?

Mini drill or application​

Report both per-job metrics and mean/worst response for three jobs at staggered arrivals. Create one invalid trace with duplicated service and one valid-conservation trace using the wrong queue order. Explain why different checks are needed.

Read this only if stuck​

Use OSTEP process abstraction to separate lifecycle timestamps; then recompute your trace manually.