← Lesson
Lab

Probe decisions

Speed
Model 0sLocal process can make progress.

Waiting for the matching handler recording…

Recorded TypeScript execution
Speed
health.ts + recorded callLoading saved call
export type HealthState = { initialized: boolean; stuck: boolean; databaseDown: boolean };

/** The HTTP server and recorded calls use this same handler. */
export function statusFor(path: string | undefined, state: HealthState) {
	if (path === '/startupz') {
		return state.initialized ? 200 : 503;
	}
	if (path === '/livez') {
		return state.stuck ? 503 : 200;
	}
	if (path === '/readyz' || path === '/tickets') {
		const canServe = state.initialized && !state.stuck && !state.databaseDown;
		return canServe ? 200 : 503;
	}
	return 404;
}

const path = "/readyz";
const state = {"initialized":true,"stuck":false,"databaseDown":false};
const status = statusFor(path, state);
console.log(status);
Recorded output
Loading…
Call stack and observed values

Inspecting the handler behind this observation. Code steps do not advance model time. With Follow code enabled, the system player steps through this call before advancing.

ClientGET /tickets
Service
Endpoint eligible
New requests reach this Pod GET /tickets → 200
Worker node · logical view
KubeletDirect Pod checks
PodReady true
Ticket APIContainer · start #1
startup0 / 24
readiness0 / 2
liveness0 / 3
Local process responding
Container restarts 0Pod identity stays the same
DatabaseAvailable
Outside the application container

Solid path: eligible traffic. Dashed path: withdrawn or unsampled. Counts: consecutive failures / limit. Select a handler to inspect its code. Probe responses precede any restart; the container below them shows the resulting state.

Evidence terminalModel 0s · modeled output

sim> kubectl get pods

NAME          READY  STATUS   RESTARTS
ticket-api    1/1    Running  0

Supported inspection commands only. No shell or cluster connection.