PostgresCounters

class PostgresCounters(connect: () -> Connection)

PostgreSQL's counters and settings around a raw run's windows, on connections from connect.

Constructors

Link copied to clipboard
constructor(connect: () -> Connection)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard

PostgreSQL's cumulative counters: WAL bytes, records, full-page images, syncs and their time, commits, the clone's snapshot table's updates and HOT updates, and the WAL's insert position (WAL_POSITION, for records).

Link copied to clipboard
fun ratios(growth: Map<String, Double>): Map<String, Double>

The share of the snapshot table's updates that were HOT, from the counters' growth.

Link copied to clipboard
fun records(before: Map<String, Double>, after: Map<String, Double>): Map<String, Double>

The WAL written between before's and after's positions (WAL_POSITION), per record type and the table it touched (an index's or TOAST table's own, its table's): wal <type> <table> records, the type <resource manager>/<record> and the table - for a record of none (a commit), and each table's record bytes, full-page images among them (wal <table> bytes). Read with pg_walinspect; empty when the extension is not there, a checkpoint recycled the segments, or the read took longer than RECORDS_TIMEOUT.

Link copied to clipboard

The server's version and the settings a ceiling is quoted with.

Link copied to clipboard

Each of Wow's tables' rows inserted, updated (HOT among them) and deleted: where a calibration's gap is.

Link copied to clipboard
fun watch(): () -> Map<String, Double>

Watches how far back open transactions hold the store's horizon while a window runs, a diagnostic of the HOT share (a dead row version an open snapshot may still see is not pruned, so its page's space is not freed for the next update): every SAMPLE_MILLIS, the oldest backend_xmin's age in transactions and the longest-open transaction holding one, in this database and besides the watcher's own. The returned stop gives their means and maxima over the window (XMIN_METRICS).