PostgreSQL Source Code
git master
|
Go to the source code of this file.
Macros | |
#define | WALSTAT_ACC(fld, var_to_add) (stats_shmem->stats.fld += var_to_add.fld) |
#define | WALSTAT_ACC_INSTR_TIME(fld) (stats_shmem->stats.fld += INSTR_TIME_GET_MICROSEC(PendingWalStats.fld)) |
Functions | |
void | pgstat_report_wal (bool force) |
PgStat_WalStats * | pgstat_fetch_stat_wal (void) |
void | pgstat_flush_wal (bool nowait) |
bool | pgstat_wal_flush_cb (bool nowait) |
void | pgstat_wal_init_backend_cb (void) |
bool | pgstat_wal_have_pending_cb (void) |
void | pgstat_wal_init_shmem_cb (void *stats) |
void | pgstat_wal_reset_all_cb (TimestampTz ts) |
void | pgstat_wal_snapshot_cb (void) |
Variables | |
PgStat_PendingWalStats | PendingWalStats = {0} |
static WalUsage | prevWalUsage |
#define WALSTAT_ACC | ( | fld, | |
var_to_add | |||
) | (stats_shmem->stats.fld += var_to_add.fld) |
#define WALSTAT_ACC_INSTR_TIME | ( | fld | ) | (stats_shmem->stats.fld += INSTR_TIME_GET_MICROSEC(PendingWalStats.fld)) |
PgStat_WalStats* pgstat_fetch_stat_wal | ( | void | ) |
Definition at line 67 of file pgstat_wal.c.
References PGSTAT_KIND_WAL, pgstat_snapshot_fixed(), pgStatLocal, PgStat_LocalState::snapshot, and PgStat_Snapshot::wal.
Referenced by pg_stat_get_wal().
void pgstat_flush_wal | ( | bool | nowait | ) |
Definition at line 78 of file pgstat_wal.c.
References pgstat_wal_flush_cb().
Referenced by pgstat_report_wal().
void pgstat_report_wal | ( | bool | force | ) |
Definition at line 48 of file pgstat_wal.c.
References pgstat_flush_io(), and pgstat_flush_wal().
Referenced by BackgroundWriterMain(), CheckpointerMain(), HandleCheckpointerInterrupts(), and WalWriterMain().
Definition at line 91 of file pgstat_wal.c.
References Assert, PgStat_ShmemControl::is_shutdown, IsPostmasterEnvironment, IsUnderPostmaster, PgStatShared_Wal::lock, LW_EXCLUSIVE, LWLockAcquire(), LWLockConditionalAcquire(), LWLockRelease(), MemSet, PendingWalStats, pgstat_wal_have_pending_cb(), pgStatLocal, pgWalUsage, prevWalUsage, PgStat_LocalState::shmem, PgStat_ShmemControl::wal, WALSTAT_ACC, WALSTAT_ACC_INSTR_TIME, and WalUsageAccumDiff().
Referenced by pgstat_flush_wal().
bool pgstat_wal_have_pending_cb | ( | void | ) |
Definition at line 168 of file pgstat_wal.c.
References PendingWalStats, pgWalUsage, prevWalUsage, WalUsage::wal_records, PgStat_PendingWalStats::wal_sync, and PgStat_PendingWalStats::wal_write.
Referenced by pgstat_wal_flush_cb().
void pgstat_wal_init_backend_cb | ( | void | ) |
void pgstat_wal_init_shmem_cb | ( | void * | stats | ) |
Definition at line 176 of file pgstat_wal.c.
References PgStatShared_Wal::lock, LWLockInitialize(), and LWTRANCHE_PGSTATS_DATA.
void pgstat_wal_reset_all_cb | ( | TimestampTz | ts | ) |
Definition at line 184 of file pgstat_wal.c.
References PgStatShared_Wal::lock, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), pgStatLocal, PgStat_LocalState::shmem, PgStat_WalStats::stat_reset_timestamp, PgStatShared_Wal::stats, and PgStat_ShmemControl::wal.
void pgstat_wal_snapshot_cb | ( | void | ) |
Definition at line 195 of file pgstat_wal.c.
References PgStatShared_Wal::lock, LW_SHARED, LWLockAcquire(), LWLockRelease(), pgStatLocal, PgStat_LocalState::shmem, PgStat_LocalState::snapshot, PgStatShared_Wal::stats, PgStat_ShmemControl::wal, and PgStat_Snapshot::wal.
PgStat_PendingWalStats PendingWalStats = {0} |
Definition at line 24 of file pgstat_wal.c.
Referenced by AdvanceXLInsertBuffer(), issue_xlog_fsync(), pgstat_wal_flush_cb(), pgstat_wal_have_pending_cb(), and XLogWrite().
|
static |
Definition at line 32 of file pgstat_wal.c.
Referenced by pgstat_wal_flush_cb(), pgstat_wal_have_pending_cb(), and pgstat_wal_init_backend_cb().