Compare observed latency with a target budget and report the latency status.

latency budget The budget gives a fixed target that every observed latency can be compared against.
latency label The label summarizes whether the report is fast, watchful, or slow.

Latency Budget Reliability Report

observedMs
latency_budget_reliability_report.c
Replay: real traced execution (multi-file project)
#include <stdio.h>

int main(void) {
    int observedMs = 180;
    int targetMs = 200;
    const char *status = "watch";

    if (observedMs <= targetMs / 2 + 30) {
        status = "fast";
    }

    if (observedMs > targetMs) {
        status = "slow";
    }

    printf("observed=%d\n", observedMs);
    printf("target=%d\n", targetMs);
    printf("status=%s\n", status);
    return 0;
}
#include <stdio.h>

int main(void) {
    int observedMs = 120;
    int targetMs = 200;
    const char *status = "watch";

    if (observedMs <= targetMs / 2 + 30) {
        status = "fast";
    }

    if (observedMs > targetMs) {
        status = "slow";
    }

    printf("observed=%d\n", observedMs);
    printf("target=%d\n", targetMs);
    printf("status=%s\n", status);
    return 0;
}
#include <stdio.h>

int main(void) {
    int observedMs = 260;
    int targetMs = 200;
    const char *status = "watch";

    if (observedMs <= targetMs / 2 + 30) {
        status = "fast";
    }

    if (observedMs > targetMs) {
        status = "slow";
    }

    printf("observed=%d\n", observedMs);
    printf("target=%d\n", targetMs);
    printf("status=%s\n", status);
    return 0;
}
  1. observedMs ← 180, targetMs ← 200, status ← watch

    3int main(void) {4    int observedMs→ 180 = 180; //@observedMs=120, 2605    int targetMs→ 200 = 200;6    const char *status→ watch = "watch";78    if (observedMs <= targetMs / 2 + 30) {9        status = "fast";10    }1112    if (observedMs > targetMs) {13        status = "slow";14    }1516    printf("observed=%d\n", observedMs180);17    printf("target=%d\n", targetMs200);18    printf("status=%s\n", statuswatch);19    return 0;20}
    outputobserved=180
    target=200
    status=watch
  1. observedMs ← 120, targetMs ← 200, status ← watch

    3int main(void) {4    int observedMs→ 120 = 120;5    int targetMs→ 200 = 200;6    const char *status→ watch = "watch";
  2. status ← fast

    8if (observedMs120 <= targetMs200 / 2 + 30) {9    status→ fast = "fast";10}
  3. printf("observed=%d ", observedMs);

    16    printf("observed=%d\n", observedMs120);17    printf("target=%d\n", targetMs200);18    printf("status=%s\n", statusfast);19    return 0;20}
    outputobserved=120
    target=200
    status=fast
  1. observedMs ← 260, targetMs ← 200, status ← watch

    3int main(void) {4    int observedMs→ 260 = 260;5    int targetMs→ 200 = 200;6    const char *status→ watch = "watch";
  2. status ← slow

    12if (observedMs260 > targetMs200) {13    status→ slow = "slow";14}
  3. printf("observed=%d ", observedMs);

    16    printf("observed=%d\n", observedMs260);17    printf("target=%d\n", targetMs200);18    printf("status=%s\n", statusslow);19    return 0;20}
    outputobserved=260
    target=200
    status=slow