Docs / Reference

Data, storage and retention

Where ProcessGuard keeps its history, what it keeps, and for how long.

Location

SQLite in WAL mode, at the data path of the mode:

ModeDatabaseSocketPID file
Full (root)/Library/Application Support/ProcessGuard/daemon.db/var/run/pguard/daemon.sockdaemon.pid next to the socket
Limited (user)~/.pguard/daemon.db~/.pguard/daemon.sockdaemon.pid next to the socket

Only one daemon per mode runs at a time: the PID file blocks a second instance. A stale socket file is removed at startup. The two modes keep separate histories.

What is stored

A process row is stored at each 30-second write when its score is above zero, or when a watch covers it. An idle process therefore leaves no rows by default.

Retention

DataRawDownsampled
Process snapshots24 h5-minute buckets for 7 days
Battery events7 days—
System state (RAM, thermal, load)7 days—
Traffic per process and remote host—5-minute buckets for 7 days
Action logThe last 10 000 attempts—

Cleanup runs every hour with an incremental vacuum, so the database does not grow without bound.

Time windows

WindowDurationBucket sizeAbout points
LastHour (1h)1 hour30 s120
Last6Hours (6h)6 hours2 min180
Last24Hours (24h)24 hours5 min288
Last7Days (7d)7 days30 min336

A query reads each stretch of the window from the finest tier that still holds it, and each stretch from exactly one tier, so nothing is counted twice. A point reports resolution_secs: older history exists only at 5-minute resolution. History of one run (PID plus start time) reads raw rows only, so it reaches back 24 hours.

Watches

A watch stores its target at every write, whatever its score. Use one before you measure a quiet process, so "stayed idle" is not confused with "was not recorded".

pguard watch add --name cargo --ttl 1800      # every process named cargo, for 30 minutes
pguard watch add --pid 998 --start-time 91998112   # one run
pguard watch list
pguard watch remove 3

Failure handling

CaseBehaviour
A process exits during a sampleIt is skipped. pids_listed and pids_sampled in GetStatus show the difference.
A failed sample or writeThe last good state is kept. The failure is reported in GetStatus.collector.
The database cannot be openedThe daemon exits with an error.
A slow subscriberMissed events are counted in subscriber_lagged_events.