Monitor quality day by day and log each issue to its source

capstone · 90 min · Objective 5.4

Task

The domain 5 capstone. Build daily quality monitoring for the sensor data -- completeness and spikes per day -- raise an alert for every bad day, log each as an issue with an owner and a fix at the source, and summarise the lot.

Steps

  1. Save lab/monitor/daily.csv with header date,readings,completeness,spikes, one row per day of data/sensor.csv: completeness is readings divided by 24, as a percentage to one decimal place, and spikes counts readings above 30.
  2. Write lab/monitor/alerts.txt with one line for each day whose completeness is under 100 or whose spikes are above 0: ALERT DATE completeness N spikes N.
  3. Save lab/monitor/issues.csv with header id,date,dimension,description,owner,source_fix, one row per alert.
  4. Write lab/monitor/summary.md with the headings ## Baseline, ## Alerts, ## Root causes and ## Fixed at source.

Verify

These checks run in a POSIX shell with Python 3: Terminal on macOS or Linux, and on Windows Git Bash (it comes with Git for Windows) or WSL. On Windows, python3 is often a Microsoft Store placeholder that prints “Python was not found”; run alias python3=py in Git Bash first.

echo "days: $(($(wc -l < lab/monitor/daily.csv) - 1))"
cat lab/monitor/alerts.txt
awk -F, 'NR>1' lab/monitor/issues.csv | wc -l
grep -cE '^## (Baseline|Alerts|Root causes|Fixed at source)' lab/monitor/summary.md

60 days and six alerts: 2025-07-21 at 83.3% and 2025-07-22 at 66.7% (the 12-hour gap, split across midnight), and one spike each on 2025-07-07, 2025-07-26, 2025-08-07 and 2025-08-24. Six issues are logged and the summary has all 4 headings. The spikes read 36.7 to 39.3 against a normal ceiling of 23.0, so a threshold of 30 separates them cleanly -- and the fix for both kinds of issue is at the sensor, not in the report.

This is an independent study companion for CompTIA Data+ DA0-002 and is not produced by or endorsed by CompTIA.