Open lesson

Mission: the page that never arrives

Command palette

This mission workspace keeps code and notes in this browser tab. Export them before closing it. Running code is practice, not an automatic grade for the mission.

Brief

Define a freshness alert using an SLI, an SLO, and explicit measurement windows.

Imani is waiting for the log page that might confirm the crashed car's journey. Voss wants the report published immediately. Mara hands you three windows of ten expected deliveries: 9, then 8, then 7 pages on time. Decide when to notify the team and what to inspect before the fictional meeting. The urgency is in the story; the exercise has no timer.

Your mission

  1. Define the freshness SLI and its denominator.
  2. Calculate each window's percentage and say whether the 90% SLO is met.
  3. Apply the rule of two successive windows below the SLO.
  4. Write an alert that helps Imani without accusing a person.

How to check your work

  • SLI = pages available within 15 minutes / pages expected.
  • W1 = 90%, W2 = 80%, W3 = 70%.
  • This rule alerts at W3 only.
  • Message includes service, numbers, period, and a check of originals; no accusation.

Course example

# Fictional, non-overlapping windows of ten deliveries.
on_time_counts = [9, 8, 7]
target_percent = 90
previous_below = False

for window, on_time in enumerate(on_time_counts, start=1):
    percent = 100 * on_time / 10
    below = percent < target_percent
    alert = below and previous_below
    print(f"W{window}: {percent:.0f}% on time; alert={alert}")
    previous_below = below

Code

Use Tab to leave the editor. Ctrl+Enter runs the source. The lines beginning with # are task reminders. Python ignores them. Write your code beneath them.

Python console

Loading laboratory…

Explore Python or SQL here; this is not an operating-system shell.

This is a disposable browser experiment. The code run here is not recorded as a completed mission.

Each command starts a fresh disposable worker: it runs a captured copy of your current source, then your command with the lesson fixtures. Changes are discarded afterward. Commands never save source or award XP. Ctrl+Enter executes the command.

Virtual workspace files

Source and declarative assets are readable here without JavaScript. Python input files are created at runtime; SQL setup initializes the disposable database.

source.py

Current editor source. Inspection shows your current edits.

# Define the freshness SLI and its denominator.
# Calculate each window's percentage and say whether the 90% SLO is met.
# Apply the rule of two successive windows below the SLO.
# Write an alert that helps Imani without accusing a person.

exemple.py

Declarative lesson asset; this is not a file created in the Python filesystem.

# Fictional, non-overlapping windows of ten deliveries.
on_time_counts = [9, 8, 7]
target_percent = 90
previous_below = False

for window, on_time in enumerate(on_time_counts, start=1):
    percent = 100 * on_time / 10
    below = percent < target_percent
    alert = below and previous_below
    print(f"W{window}: {percent:.0f}% on time; alert={alert}")
    previous_below = below