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

latency budget The target budget gives every observed latency a clear comparison point.
latency label The label summarizes whether the report is fast, watchful, or slow.

Latency Budget Reliability Report

observedMs
latency_budget_reliability_report.cpp
Replay: real traced execution (multi-file project)
#include <iostream>
#include <string>

int main() {
    int observedMs = 180;
    int targetMs = 200;
    std::string status = "watch";

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

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

    std::cout << "observed=" << observedMs << std::endl;
    std::cout << "target=" << targetMs << std::endl;
    std::cout << "status=" << status << std::endl;
    return 0;
}
#include <iostream>
#include <string>

int main() {
    int observedMs = 120;
    int targetMs = 200;
    std::string status = "watch";

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

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

    std::cout << "observed=" << observedMs << std::endl;
    std::cout << "target=" << targetMs << std::endl;
    std::cout << "status=" << status << std::endl;
    return 0;
}
#include <iostream>
#include <string>

int main() {
    int observedMs = 260;
    int targetMs = 200;
    std::string status = "watch";

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

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

    std::cout << "observed=" << observedMs << std::endl;
    std::cout << "target=" << targetMs << std::endl;
    std::cout << "status=" << status << std::endl;
    return 0;
}
  1. observedMs ← 180, targetMs ← 200, status ← watch

    4int main() {5    int observedMs→ 180 = 180; //@observedMs=120, 2606    int targetMs→ 200 = 200;7    std::string status→ watch = "watch";89    if (observedMs <= targetMs / 2 + 30) {10        status = "fast";11    }1213    if (observedMs > targetMs) {14        status = "slow";15    }1617    std::cout << "observed=" << observedMs180 << std::endl;18    std::cout << "target=" << targetMs200 << std::endl;19    std::cout << "status=" << statuswatch << std::endl;20    return 0;21}
    outputobserved=180
    target=200
    status=watch
  1. observedMs ← 120, targetMs ← 200, status ← watch

    4int main() {5    int observedMs→ 120 = 120;6    int targetMs→ 200 = 200;7    std::string status→ watch = "watch";
  2. status ← fast

    9if (observedMs120 <= targetMs200 / 2 + 30) {10    status→ fast = "fast";11}
  3. std::cout << "observed=" << observedMs << std::endl;

    17    std::cout << "observed=" << observedMs120 << std::endl;18    std::cout << "target=" << targetMs200 << std::endl;19    std::cout << "status=" << statusfast << std::endl;20    return 0;21}
    outputobserved=120
    target=200
    status=fast
  1. observedMs ← 260, targetMs ← 200, status ← watch

    4int main() {5    int observedMs→ 260 = 260;6    int targetMs→ 200 = 200;7    std::string status→ watch = "watch";
  2. status ← slow

    13if (observedMs260 > targetMs200) {14    status→ slow = "slow";15}
  3. std::cout << "observed=" << observedMs << std::endl;

    17    std::cout << "observed=" << observedMs260 << std::endl;18    std::cout << "target=" << targetMs200 << std::endl;19    std::cout << "status=" << statusslow << std::endl;20    return 0;21}
    outputobserved=260
    target=200
    status=slow