dan-polling

Monitors Dan's ATProto DID endpoint every minute, stores results in SQLite, and sends an hourly email digest.

Architecture

Rendering mermaid diagram...

Files

FileTypeDescription
main.tsInterval (1 min)Polls the endpoint, records status code & latency into SQLite
hourly-email.tsInterval (1 hr)Queries SQLite for stats and sends an HTML email digest
dashboard.tsxHTTPWeb dashboard showing response time chart, stats, and poll log

Database

Uses a val-scoped SQLite database (std/sqlite@14-main) with a single table:

CREATE TABLE poll_log ( id INTEGER PRIMARY KEY AUTOINCREMENT, started_at TEXT NOT NULL, ended_at TEXT NOT NULL, duration_ms INTEGER NOT NULL, status_code INTEGER, error TEXT );

Email

Hourly digest emails are sent via std/email and include:

  • Last hour: poll count, uptime %, avg/min/max response time, error count
  • All time: total polls, uptime %, avg response time, total errors
  • Error table: recent failures with timestamps, status codes, and messages