Datum pg_stat_get_bgwriter_requested_checkpoints(PG_FUNCTION_ARGS) { PG_RETURN_INT64(pgstat_fetch_global()->requested_checkpoints); }
Datum pg_stat_get_buf_alloc(PG_FUNCTION_ARGS) { PG_RETURN_INT64(pgstat_fetch_global()->buf_alloc); }
/* Get the timestamp of the current statistics snapshot */ Datum pg_stat_get_snapshot_timestamp(PG_FUNCTION_ARGS) { PG_RETURN_TIMESTAMPTZ(pgstat_fetch_global()->stats_timestamp); }
Datum pg_stat_get_buf_fsync_backend(PG_FUNCTION_ARGS) { PG_RETURN_INT64(pgstat_fetch_global()->buf_fsync_backend); }
Datum pg_stat_get_bgwriter_stat_reset_time(PG_FUNCTION_ARGS) { PG_RETURN_TIMESTAMPTZ(pgstat_fetch_global()->stat_reset_timestamp); }
Datum pg_stat_get_checkpoint_sync_time(PG_FUNCTION_ARGS) { /* time is already in msec, just convert to double for presentation */ PG_RETURN_FLOAT8((double) pgstat_fetch_global()->checkpoint_sync_time); }
Datum pg_stat_get_bgwriter_maxwritten_clean(PG_FUNCTION_ARGS) { PG_RETURN_INT64(pgstat_fetch_global()->maxwritten_clean); }
Datum pg_stat_get_bgwriter_buf_written_checkpoints(PG_FUNCTION_ARGS) { PG_RETURN_INT64(pgstat_fetch_global()->buf_written_checkpoints); }