PostgreSQL Source Code git master
|
#include "postgres.h"
#include "storage/procsignal.h"
#include "utils/pgstat_internal.h"
#include "utils/timestamp.h"
Go to the source code of this file.
Macros | |
#define | PGSTAT_ACCUM_DBCOUNT(item) (sharedent)->stats.item += (pendingent)->item |
Variables | |
PgStat_Counter | pgStatBlockReadTime = 0 |
PgStat_Counter | pgStatBlockWriteTime = 0 |
PgStat_Counter | pgStatActiveTime = 0 |
PgStat_Counter | pgStatTransactionIdleTime = 0 |
SessionEndType | pgStatSessionEndCause = DISCONNECT_NORMAL |
static int | pgStatXactCommit = 0 |
static int | pgStatXactRollback = 0 |
static PgStat_Counter | pgLastSessionReportTime = 0 |
#define PGSTAT_ACCUM_DBCOUNT | ( | item | ) | (sharedent)->stats.item += (pendingent)->item |
void AtEOXact_PgStat_Database | ( | bool | isCommit, |
bool | parallel | ||
) |
Definition at line 249 of file pgstat_database.c.
References pgStatXactCommit, and pgStatXactRollback.
Referenced by AtEOXact_PgStat().
bool pgstat_database_flush_cb | ( | PgStat_EntryRef * | entry_ref, |
bool | nowait | ||
) |
Definition at line 392 of file pgstat_database.c.
References Assert(), PgStat_StatDBEntry::checksum_failures, PgStat_StatDBEntry::last_autovac_time, PgStat_StatDBEntry::last_checksum_failure, PgStat_EntryRef::pending, PGSTAT_ACCUM_DBCOUNT, pgstat_lock_entry(), pgstat_unlock_entry(), and PgStat_EntryRef::shared_stats.
void pgstat_database_reset_timestamp_cb | ( | PgStatShared_Common * | header, |
TimestampTz | ts | ||
) |
Definition at line 457 of file pgstat_database.c.
void pgstat_drop_database | ( | Oid | databaseid | ) |
Definition at line 44 of file pgstat_database.c.
References InvalidOid, pgstat_drop_transactional(), and PGSTAT_KIND_DATABASE.
Referenced by dropdb().
PgStat_StatDBEntry * pgstat_fetch_stat_dbentry | ( | Oid | dboid | ) |
Definition at line 242 of file pgstat_database.c.
References InvalidOid, pgstat_fetch_entry(), and PGSTAT_KIND_DATABASE.
Referenced by do_start_worker(), pg_stat_get_db_checksum_failures(), pg_stat_get_db_checksum_last_failure(), pg_stat_get_db_conflict_all(), pg_stat_get_db_stat_reset_time(), and rebuild_database_list().
PgStat_StatDBEntry * pgstat_prep_database_pending | ( | Oid | dboid | ) |
Definition at line 350 of file pgstat_database.c.
References Assert(), InvalidOid, MyDatabaseId, OidIsValid, PgStat_EntryRef::pending, PGSTAT_KIND_DATABASE, and pgstat_prep_pending_entry().
Referenced by pgstat_relation_flush_cb(), pgstat_report_connect(), pgstat_report_deadlock(), pgstat_report_disconnect(), pgstat_report_recovery_conflict(), pgstat_report_tempfile(), pgstat_update_dbstats(), and pgstat_update_parallel_workers_stats().
void pgstat_report_autovac | ( | Oid | dboid | ) |
Definition at line 55 of file pgstat_database.c.
References Assert(), GetCurrentTimestamp(), InvalidOid, IsUnderPostmaster, PgStat_StatDBEntry::last_autovac_time, pgstat_get_entry_ref_locked(), PGSTAT_KIND_DATABASE, pgstat_unlock_entry(), PgStat_EntryRef::shared_stats, and PgStatShared_Database::stats.
Referenced by AutoVacWorkerMain().
void pgstat_report_checksum_failure | ( | void | ) |
Definition at line 166 of file pgstat_database.c.
References MyDatabaseId, and pgstat_report_checksum_failures_in_db().
Referenced by PageIsVerifiedExtended().
void pgstat_report_checksum_failures_in_db | ( | Oid | dboid, |
int | failurecount | ||
) |
Definition at line 140 of file pgstat_database.c.
References PgStat_StatDBEntry::checksum_failures, GetCurrentTimestamp(), InvalidOid, PgStat_StatDBEntry::last_checksum_failure, pgstat_get_entry_ref_locked(), PGSTAT_KIND_DATABASE, pgstat_track_counts, pgstat_unlock_entry(), PgStat_EntryRef::shared_stats, and PgStatShared_Database::stats.
Referenced by pgstat_report_checksum_failure(), and sendFile().
void pgstat_report_connect | ( | Oid | dboid | ) |
Definition at line 191 of file pgstat_database.c.
References MyDatabaseId, MyStartTimestamp, pgLastSessionReportTime, pgstat_prep_database_pending(), pgstat_should_report_connstat(), and PgStat_StatDBEntry::sessions.
Referenced by PostgresMain().
void pgstat_report_deadlock | ( | void | ) |
Definition at line 125 of file pgstat_database.c.
References PgStat_StatDBEntry::deadlocks, MyDatabaseId, pgstat_prep_database_pending(), and pgstat_track_counts.
Referenced by DeadLockReport().
void pgstat_report_disconnect | ( | Oid | dboid | ) |
Definition at line 208 of file pgstat_database.c.
References DISCONNECT_CLIENT_EOF, DISCONNECT_FATAL, DISCONNECT_KILLED, DISCONNECT_NORMAL, DISCONNECT_NOT_YET, MyDatabaseId, pgstat_prep_database_pending(), pgstat_should_report_connstat(), pgStatSessionEndCause, PgStat_StatDBEntry::sessions_abandoned, PgStat_StatDBEntry::sessions_fatal, and PgStat_StatDBEntry::sessions_killed.
Referenced by pgstat_shutdown_hook().
void pgstat_report_recovery_conflict | ( | int | reason | ) |
Definition at line 81 of file pgstat_database.c.
References Assert(), PgStat_StatDBEntry::conflict_bufferpin, PgStat_StatDBEntry::conflict_lock, PgStat_StatDBEntry::conflict_logicalslot, PgStat_StatDBEntry::conflict_snapshot, PgStat_StatDBEntry::conflict_startup_deadlock, PgStat_StatDBEntry::conflict_tablespace, IsUnderPostmaster, MyDatabaseId, pgstat_prep_database_pending(), pgstat_track_counts, PROCSIG_RECOVERY_CONFLICT_BUFFERPIN, PROCSIG_RECOVERY_CONFLICT_DATABASE, PROCSIG_RECOVERY_CONFLICT_LOCK, PROCSIG_RECOVERY_CONFLICT_LOGICALSLOT, PROCSIG_RECOVERY_CONFLICT_SNAPSHOT, PROCSIG_RECOVERY_CONFLICT_STARTUP_DEADLOCK, and PROCSIG_RECOVERY_CONFLICT_TABLESPACE.
Referenced by ProcessRecoveryConflictInterrupt().
void pgstat_report_tempfile | ( | size_t | filesize | ) |
Definition at line 175 of file pgstat_database.c.
References MyDatabaseId, pgstat_prep_database_pending(), pgstat_track_counts, PgStat_StatDBEntry::temp_bytes, and PgStat_StatDBEntry::temp_files.
Referenced by ReportTemporaryFileUsage().
void pgstat_reset_database_timestamp | ( | Oid | dboid, |
TimestampTz | ts | ||
) |
Definition at line 371 of file pgstat_database.c.
References InvalidOid, MyDatabaseId, pgstat_get_entry_ref_locked(), PGSTAT_KIND_DATABASE, pgstat_unlock_entry(), PgStat_EntryRef::shared_stats, PgStat_StatDBEntry::stat_reset_timestamp, and PgStatShared_Database::stats.
Referenced by pgstat_reset().
|
static |
Definition at line 341 of file pgstat_database.c.
References B_BACKEND, and MyBackendType.
Referenced by pgstat_report_connect(), pgstat_report_disconnect(), and pgstat_update_dbstats().
void pgstat_update_dbstats | ( | TimestampTz | ts | ) |
Definition at line 287 of file pgstat_database.c.
References PgStat_StatDBEntry::active_time, PgStat_StatDBEntry::blk_read_time, PgStat_StatDBEntry::blk_write_time, PgStat_StatDBEntry::idle_in_transaction_time, MyDatabaseId, OidIsValid, pgLastSessionReportTime, pgstat_prep_database_pending(), pgstat_should_report_connstat(), pgStatActiveTime, pgStatBlockReadTime, pgStatBlockWriteTime, pgStatTransactionIdleTime, pgStatXactCommit, pgStatXactRollback, PgStat_StatDBEntry::session_time, TimestampDifference(), PgStat_StatDBEntry::xact_commit, and PgStat_StatDBEntry::xact_rollback.
Referenced by pgstat_report_stat().
void pgstat_update_parallel_workers_stats | ( | PgStat_Counter | workers_to_launch, |
PgStat_Counter | workers_launched | ||
) |
Definition at line 269 of file pgstat_database.c.
References MyDatabaseId, OidIsValid, PgStat_StatDBEntry::parallel_workers_launched, PgStat_StatDBEntry::parallel_workers_to_launch, and pgstat_prep_database_pending().
Referenced by standard_ExecutorEnd().
|
static |
Definition at line 37 of file pgstat_database.c.
Referenced by pgstat_report_connect(), and pgstat_update_dbstats().
PgStat_Counter pgStatActiveTime = 0 |
Definition at line 30 of file pgstat_database.c.
Referenced by pgstat_update_dbstats().
PgStat_Counter pgStatBlockReadTime = 0 |
Definition at line 28 of file pgstat_database.c.
Referenced by do_analyze_rel(), heap_vacuum_rel(), and pgstat_update_dbstats().
PgStat_Counter pgStatBlockWriteTime = 0 |
Definition at line 29 of file pgstat_database.c.
Referenced by do_analyze_rel(), heap_vacuum_rel(), and pgstat_update_dbstats().
SessionEndType pgStatSessionEndCause = DISCONNECT_NORMAL |
Definition at line 32 of file pgstat_database.c.
Referenced by die(), errfinish(), pgstat_report_disconnect(), and PostgresMain().
PgStat_Counter pgStatTransactionIdleTime = 0 |
Definition at line 31 of file pgstat_database.c.
Referenced by pgstat_update_dbstats().
|
static |
Definition at line 35 of file pgstat_database.c.
Referenced by AtEOXact_PgStat_Database(), and pgstat_update_dbstats().
|
static |
Definition at line 36 of file pgstat_database.c.
Referenced by AtEOXact_PgStat_Database(), and pgstat_update_dbstats().