{
  "_": "Raw benchmark output. Generated by scripts/bench/scheduler.mjs.",
  "startedAt": "2026-08-12T22:57:26.608Z",
  "window": {
    "start": "2026-08-12T22:58:37.133Z",
    "end": "2026-08-12T23:00:38.088Z",
    "seconds": 120.955,
    "warmupSeconds": 70
  },
  "configured": {
    "monitors": 2000,
    "activeMonitorsInDatabase": 2000,
    "workers": 4,
    "intervalSeconds": 60,
    "schedulerBatch": 500,
    "expectedChecksPerSecond": 33.333333333333336
  },
  "measuredFrom": {
    "table": "monitor_checks",
    "column": "checked_at",
    "note": "The ordinary plane writes one observation per check. Cadence, coverage and duplicates are all read from this table; the scheduler's own backlog is read from monitors.next_evaluation_at."
  },
  "achieved": {
    "checks": 3951,
    "checksPerSecond": 32.665040717622254,
    "distinctMonitors": 2000,
    "coverage": 1,
    "expectedChecks": 4031,
    "missedChecks": 80,
    "failures": 0,
    "errorRate": 0,
    "duplicateObservations": 0,
    "duplicateThresholdSeconds": 3.75
  },
  "jobFailures": {},
  "schedulerLagSeconds": {
    "samples": 120,
    "p50": 1.002032,
    "p95": 2.056066,
    "p99": 2.106337,
    "min": 0,
    "max": 2.126997
  },
  "dueBacklog": {
    "samples": 120,
    "p50": 70,
    "p95": 93,
    "p99": 115,
    "min": 0,
    "max": 116
  },
  "queueDepth": {
    "samples": 120,
    "p50": 2000,
    "p95": 2012,
    "p99": 2056,
    "min": 2000,
    "max": 2061
  },
  "catchUp": {
    "note": "The seeded fleet is entirely due at t=0. This is the burst a scheduler faces after a restart or a rolling deploy.",
    "seconds": 70,
    "lagSeconds": {
      "samples": 70,
      "p50": 16.35285,
      "p95": 47.55523,
      "p99": 50.577387,
      "min": 0,
      "max": 50.577387
    },
    "dueBacklog": {
      "samples": 70,
      "p50": 720,
      "p95": 2000,
      "p99": 2000,
      "min": 0,
      "max": 2000
    },
    "clearedAfterSeconds": 51
  },
  "tick": {
    "ticks": 2,
    "avgMs": 8.757,
    "maxMs": 9.814,
    "periodSeconds": 60
  },
  "database": {
    "transactions": 29945,
    "transactionsPerSecond": 247.57141085527675,
    "walBytes": 14532360,
    "checkRowsWritten": 3951,
    "checkTableGrowthBytes": 1359872,
    "deadlocks": 0,
    "lockWaiters": {
      "samples": 120,
      "p50": 0,
      "p95": 19,
      "p99": 29,
      "min": 0,
      "max": 31
    },
    "connections": {
      "samples": 120,
      "p50": 65,
      "p95": 68,
      "p99": 68,
      "min": 18,
      "max": 68
    }
  },
  "caveats": [
    "This measures CADENCE - whether checks happen as often as configured - not detection time. A monitor is judged down only after its failure window elapses, and alert delivery is a third thing again with its own retries.",
    "Throughput is bounded by DEMAND, not by capacity. 1000 monitors on a 60-second interval require 16.67 checks per second, so a result at 16.6 means the fleet is being kept up with; it is not the largest rate the workers could reach.",
    "Duplicate observations count pairs closer together than the TIGHTEST gap the adaptive scheduler can ask for, which is interval/16. A wider threshold counts the scheduler tightening on a monitor that failed once as duplicate work: the first version of this script used half an interval and reported dozens of duplicates against builds that had none.",
    "Targets are local HTTP servers on a spread of ports. This measures the scheduler and the database, not anybody's network, and a real fleet's checks take longer.",
    "Workers, Postgres and the targets share one machine. Worker scaling measured here is therefore a LOWER bound on a deployment where they do not compete for the same CPUs.",
    "The catch-up figure is the burst after every monitor is made due at once. That is the state a restart leaves, and it is deliberately the worst case rather than the ordinary one.",
    "database.transactions and database.deadlocks come from pg_stat_database summed across the WHOLE CLUSTER, not this database alone. On a cluster hosting anything else, both are upper bounds rather than measurements of this run.",
    "schedulerLag is now() minus next_evaluation_at with no grace period, over monitors that are late but not necessarily selectable. It is deliberately immune to the scheduler claim: the claim leases a monitor in its own column, so a backlog does not vanish the moment a tick looks at it."
  ],
  "environment": {
    "commit": "0b4e995c3e850c2bb89ab41dc1f0880f413cbb53",
    "treeDirty": false,
    "node": "v26.4.0",
    "os": "Linux 7.1.4-1-cachyos",
    "hostname": "Linux",
    "cpuModel": "AMD Ryzen 7 7445HS w/ Radeon 740M Graphics",
    "cpuCount": 12,
    "totalMemBytes": 15975034880,
    "freeMemBytesAtStart": 6122885120,
    "postgres": "18.4",
    "postgresSettings": {
      "fsync": "on",
      "max_connections": "100",
      "shared_buffers": "16384",
      "synchronous_commit": "on",
      "wal_level": "replica",
      "work_mem": "4096"
    }
  }
}
