โ† W31D1 hub ยท Logging Demo

Logging Demo

Streams synthetic predict requests so you can see INFO / WARNING / ERROR in real time. Tune the knobs and watch the log surface react.

Controls

INFO WARNING (slow) ERROR

Live metrics (rolling 30s window)

Requests
0
p50 latency
โ€”
p95 latency
โ€”
Slow %
0%
Error rate
0%
Try this: set the slow threshold to 200ms and notice how the WARNING rate climbs even though nothing actually broke. Bad thresholds = alert fatigue. Click Inject incident to simulate a sudden latency + error spike.

Log stream

Equivalent Python (run it yourself)

import logging, random, time

logging.basicConfig(
    level=logging.INFO,
    format="%(asctime)s %(levelname)s %(message)s",
)

SLOW_MS = 500
ERROR_RATE = 0.03

def predict(req_id):
    latency = random.gauss(180, 60)
    logging.info(f"predict req_id={req_id} latency_ms={latency:.0f}")
    if latency > SLOW_MS:
        logging.warning(f"slow predict req_id={req_id} latency_ms={latency:.0f}")
    if random.random() < ERROR_RATE:
        logging.error(f"model failure req_id={req_id}")

for i in range(50):
    predict(f"r{i:03d}")
    time.sleep(0.2)