|
PostgreSQL Source Code git master
|
#include "access/transam.h"#include "datatype/timestamp.h"#include "portability/instr_time.h"#include "postmaster/pgarch.h"#include "replication/conflict.h"#include "replication/worker_internal.h"#include "utils/backend_progress.h"#include "utils/backend_status.h"#include "utils/pgstat_kind.h"#include "utils/relcache.h"#include "utils/wait_event.h"

Go to the source code of this file.
Data Structures | |
| struct | PgStat_FunctionCounts |
| struct | PgStat_FunctionCallUsage |
| struct | PgStat_BackendSubEntry |
| struct | PgStat_TableCounts |
| struct | PgStat_TableStatus |
| struct | PgStat_TableXactStatus |
| struct | PgStat_ArchiverStats |
| struct | PgStat_BgWriterStats |
| struct | PgStat_CheckpointerStats |
| struct | PgStat_BktypeIO |
| struct | PgStat_PendingIO |
| struct | PgStat_IO |
| struct | PgStat_StatDBEntry |
| struct | PgStat_StatFuncEntry |
| struct | PgStat_StatReplSlotEntry |
| struct | PgStat_SLRUStats |
| struct | PgStat_StatSubEntry |
| struct | PgStat_StatTabEntry |
| struct | PgStat_WalCounters |
| struct | PgStat_WalStats |
| struct | PgStat_Backend |
| struct | PgStat_BackendPending |
Enumerations | |
| enum | TrackFunctionsLevel { TRACK_FUNC_OFF , TRACK_FUNC_PL , TRACK_FUNC_ALL } |
| enum | PgStat_FetchConsistency { PGSTAT_FETCH_CONSISTENCY_NONE , PGSTAT_FETCH_CONSISTENCY_CACHE , PGSTAT_FETCH_CONSISTENCY_SNAPSHOT } |
| enum | SessionEndType { DISCONNECT_NOT_YET , DISCONNECT_NORMAL , DISCONNECT_CLIENT_EOF , DISCONNECT_FATAL , DISCONNECT_KILLED } |
| enum | IOObject { IOOBJECT_RELATION , IOOBJECT_TEMP_RELATION , IOOBJECT_WAL } |
| enum | IOContext { IOCONTEXT_BULKREAD , IOCONTEXT_BULKWRITE , IOCONTEXT_INIT , IOCONTEXT_NORMAL , IOCONTEXT_VACUUM } |
| enum | IOOp { IOOP_EVICT , IOOP_FSYNC , IOOP_HIT , IOOP_REUSE , IOOP_WRITEBACK , IOOP_EXTEND , IOOP_READ , IOOP_WRITE } |
| #define IOCONTEXT_NUM_TYPES (IOCONTEXT_VACUUM + 1) |
| #define IOOBJECT_NUM_TYPES (IOOBJECT_WAL + 1) |
| #define IOOP_NUM_TYPES (IOOP_WRITE + 1) |
| #define pgstat_count_buffer_hit | ( | rel | ) |
| #define pgstat_count_buffer_read | ( | rel | ) |
| #define pgstat_count_buffer_read_time | ( | n | ) | (pgStatBlockReadTime += (n)) |
| #define pgstat_count_buffer_write_time | ( | n | ) | (pgStatBlockWriteTime += (n)) |
| #define pgstat_count_conn_active_time | ( | n | ) | (pgStatActiveTime += (n)) |
| #define pgstat_count_conn_txn_idle_time | ( | n | ) | (pgStatTransactionIdleTime += (n)) |
| #define pgstat_count_heap_fetch | ( | rel | ) |
| #define pgstat_count_heap_getnext | ( | rel | ) |
| #define pgstat_count_heap_scan | ( | rel | ) |
| #define pgstat_count_index_scan | ( | rel | ) |
| #define pgstat_count_index_tuples | ( | rel, | |
| n | |||
| ) |
| #define PGSTAT_STAT_PERMANENT_FILENAME "pg_stat/pgstat.stat" |
| #define PGSTAT_STAT_PERMANENT_TMPFILE "pg_stat/pgstat.tmp" |
| Enumerator | |
|---|---|
| IOCONTEXT_BULKREAD | |
| IOCONTEXT_BULKWRITE | |
| IOCONTEXT_INIT | |
| IOCONTEXT_NORMAL | |
| IOCONTEXT_VACUUM | |
Definition at line 284 of file pgstat.h.
| Enumerator | |
|---|---|
| IOOBJECT_RELATION | |
| IOOBJECT_TEMP_RELATION | |
| IOOBJECT_WAL | |
| Enumerator | |
|---|---|
| IOOP_EVICT | |
| IOOP_FSYNC | |
| IOOP_HIT | |
| IOOP_REUSE | |
| IOOP_WRITEBACK | |
| IOOP_EXTEND | |
| IOOP_READ | |
| IOOP_WRITE | |
Definition at line 304 of file pgstat.h.
| Enumerator | |
|---|---|
| DISCONNECT_NOT_YET | |
| DISCONNECT_NORMAL | |
| DISCONNECT_CLIENT_EOF | |
| DISCONNECT_FATAL | |
| DISCONNECT_KILLED | |
| Enumerator | |
|---|---|
| TRACK_FUNC_OFF | |
| TRACK_FUNC_PL | |
| TRACK_FUNC_ALL | |
Definition at line 113 of file pgstat_xact.c.
References AtEOSubXact_PgStat_DroppedStats(), AtEOSubXact_PgStat_Relations(), fb(), PgStat_SubXactStatus::nest_level, pfree(), pgStatXactStack, and PgStat_SubXactStatus::prev.
Referenced by AbortSubTransaction(), and CommitSubTransaction().
Definition at line 40 of file pgstat_xact.c.
References Assert, AtEOXact_PgStat_Database(), AtEOXact_PgStat_DroppedStats(), AtEOXact_PgStat_Relations(), fb(), PgStat_SubXactStatus::nest_level, pgstat_clear_snapshot(), pgStatXactStack, and PgStat_SubXactStatus::prev.
Referenced by AbortTransaction(), CommitTransaction(), and FinishPreparedTransaction().
Definition at line 191 of file pgstat_xact.c.
References Assert, AtPrepare_PgStat_Relations(), fb(), PgStat_SubXactStatus::nest_level, pgStatXactStack, and PgStat_SubXactStatus::prev.
Referenced by PrepareTransaction().
|
extern |
Definition at line 229 of file pgstat_function.c.
References fb(), MyDatabaseId, PgStat_EntryRef::pending, pgstat_fetch_pending_entry(), and PGSTAT_KIND_FUNCTION.
Referenced by pg_stat_get_xact_function_calls().
|
extern |
Definition at line 500 of file pgstat_relation.c.
References fb(), InvalidOid, MyDatabaseId, palloc_object, PgStat_EntryRef::pending, pgstat_fetch_pending_entry(), PGSTAT_KIND_RELATION, and trans.
|
extern |
Definition at line 176 of file pgstat_replslot.c.
References fb(), InvalidOid, pgstat_get_entry_ref(), PGSTAT_KIND_REPLSLOT, and ReplicationSlotIndex().
Referenced by ReplicationSlotAcquire().
Definition at line 131 of file pgstat_relation.c.
References Assert, fb(), RelationData::pgstat_enabled, RelationData::pgstat_info, pgstat_prep_relation_pending(), RelationData::rd_rel, PgStat_TableStatus::relation, and RelationGetRelid.
Definition at line 572 of file pgstat.c.
References Assert, fb(), PgStat_ShmemControl::is_shutdown, pgstat_report_stat(), pgstat_write_statsfile(), pgStatLocal, and PgStat_LocalState::shmem.
Referenced by CheckpointerMain(), and InitPostgres().
|
extern |
Definition at line 37 of file pgstat_io.c.
References fb(), IOCONTEXT_NUM_TYPES, IOOBJECT_NUM_TYPES, IOOP_NUM_TYPES, and pgstat_tracks_io_op().
Referenced by pg_stat_get_backend_io(), pg_stat_get_io(), and pgstat_io_flush_cb().
Definition at line 912 of file pgstat.c.
References PgStat_Snapshot::context, PgStat_Snapshot::custom_valid, fb(), PgStat_Snapshot::fixed_valid, force_stats_snapshot_clear, MemoryContextDelete(), PgStat_Snapshot::mode, pgstat_assert_is_up, pgstat_clear_backend_activity_snapshot(), PGSTAT_FETCH_CONSISTENCY_NONE, pgStatLocal, PgStat_LocalState::snapshot, and PgStat_Snapshot::stats.
Referenced by AtEOXact_PgStat(), pg_stat_clear_snapshot(), pgstat_get_stat_snapshot_timestamp(), pgstat_prep_snapshot(), pgstat_snapshot_fixed(), and PostPrepare_PgStat().
Definition at line 57 of file pgstat_relation.c.
References fb(), InvalidOid, MyDatabaseId, pgstat_fetch_stat_tabentry_ext(), pgstat_get_entry_ref_locked(), PGSTAT_KIND_RELATION, pgstat_unlock_entry(), RelationData::rd_rel, RelationGetRelid, and PgStat_EntryRef::shared_stats.
Referenced by index_concurrently_swap().
|
extern |
Definition at line 74 of file pgstat_backend.c.
References Assert, backend_has_iostats, PgStat_PendingIO::bytes, PgStat_PendingIO::counts, fb(), MyBackendType, PgStat_BackendPending::pending_io, PendingBackendStats, pgstat_report_fixed, pgstat_tracks_backend_bktype(), and pgstat_tracks_io_op().
Referenced by pgstat_count_io_op().
|
extern |
Definition at line 56 of file pgstat_backend.c.
References Assert, backend_has_iostats, fb(), INSTR_TIME_ADD, MyBackendType, PgStat_BackendPending::pending_io, PgStat_PendingIO::pending_times, PendingBackendStats, pgstat_report_fixed, pgstat_tracks_backend_bktype(), pgstat_tracks_io_op(), track_io_timing, and track_wal_io_timing.
Referenced by pgstat_count_io_op_time().
Definition at line 414 of file pgstat_relation.c.
References ensure_tabstat_xact_level(), RelationData::pgstat_info, pgstat_should_count_relation, PgStat_TableStatus::trans, and PgStat_TableXactStatus::tuples_deleted.
Referenced by heap_abort_speculative(), and heap_delete().
|
extern |
Definition at line 373 of file pgstat_relation.c.
References ensure_tabstat_xact_level(), RelationData::pgstat_info, pgstat_should_count_relation, PgStat_TableStatus::trans, and PgStat_TableXactStatus::tuples_inserted.
Referenced by heap_insert(), heap_multi_insert(), and RefreshMatViewByOid().
Definition at line 388 of file pgstat_relation.c.
References Assert, PgStat_TableStatus::counts, ensure_tabstat_xact_level(), fb(), RelationData::pgstat_info, pgstat_should_count_relation, PgStat_TableStatus::trans, PgStat_TableCounts::tuples_hot_updated, PgStat_TableCounts::tuples_newpage_updated, and PgStat_TableXactStatus::tuples_updated.
Referenced by heap_update().
|
extern |
Definition at line 68 of file pgstat_io.c.
References Assert, PgStat_PendingIO::bytes, PgStat_PendingIO::counts, fb(), have_iostats, IOCONTEXT_NUM_TYPES, IOOBJECT_NUM_TYPES, MyBackendType, PendingIOStats, pgstat_count_backend_io_op(), pgstat_is_ioop_tracked_in_bytes, pgstat_report_fixed, and pgstat_tracks_io_op().
Referenced by AsyncReadBuffers(), GetLocalVictimBuffer(), GetVictimBuffer(), pgstat_count_io_op_time(), and PinBufferForBlock().
|
extern |
Definition at line 122 of file pgstat_io.c.
References fb(), INSTR_TIME_ADD, INSTR_TIME_GET_MICROSEC, INSTR_TIME_IS_ZERO, INSTR_TIME_SET_CURRENT, INSTR_TIME_SUBTRACT, IOOBJECT_RELATION, IOOBJECT_TEMP_RELATION, IOOBJECT_WAL, IOOP_EXTEND, IOOP_READ, IOOP_WRITE, BufferUsage::local_blk_read_time, BufferUsage::local_blk_write_time, PgStat_PendingIO::pending_times, PendingIOStats, pgBufferUsage, pgstat_count_backend_io_op_time(), pgstat_count_buffer_read_time, pgstat_count_buffer_write_time, pgstat_count_io_op(), BufferUsage::shared_blk_read_time, BufferUsage::shared_blk_write_time, and start_time.
Referenced by AsyncReadBuffers(), ExtendBufferedRelLocal(), ExtendBufferedRelShared(), FlushBuffer(), FlushLocalBuffer(), issue_xlog_fsync(), IssuePendingWritebacks(), mdsyncfiletag(), register_dirty_segment(), WaitReadBuffers(), WALRead(), XLogFileInitInternal(), XLogPageRead(), XLogWalRcvWrite(), and XLogWrite().
Referenced by SimpleLruDoesPhysicalPageExist().
Referenced by SimpleLruReadPage(), and SimpleLruReadPage_ReadOnly().
Referenced by SimpleLruReadPage().
Referenced by SlruPhysicalWritePage().
Referenced by SimpleLruZeroPage().
Referenced by SimpleLruWriteAll().
Referenced by SimpleLruTruncate().
Definition at line 429 of file pgstat_relation.c.
References ensure_tabstat_xact_level(), RelationData::pgstat_info, pgstat_should_count_relation, save_truncdrop_counters(), PgStat_TableStatus::trans, PgStat_TableXactStatus::tuples_deleted, PgStat_TableXactStatus::tuples_inserted, and PgStat_TableXactStatus::tuples_updated.
Referenced by ExecuteTruncateGuts(), and RefreshMatViewByOid().
|
extern |
Definition at line 323 of file pgstat_backend.c.
References backend_has_iostats, fb(), InvalidOid, MemSet, MyProcNumber, PendingBackendStats, pgstat_get_entry_ref_locked(), PGSTAT_KIND_BACKEND, pgstat_unlock_entry(), pgWalUsage, prevBackendWalUsage, and PgStat_EntryRef::shared_stats.
Referenced by pgstat_bestart_final().
Definition at line 45 of file pgstat_function.c.
References fb(), MyDatabaseId, pgstat_create_transactional(), and PGSTAT_KIND_FUNCTION.
Referenced by ProcedureCreate().
Definition at line 168 of file pgstat_relation.c.
References InvalidOid, MyDatabaseId, pgstat_create_transactional(), PGSTAT_KIND_RELATION, RelationData::rd_rel, and RelationGetRelid.
Referenced by heap_create().
|
extern |
Definition at line 141 of file pgstat_replslot.c.
References Assert, fb(), InvalidOid, LW_EXCLUSIVE, LWLockHeldByMeInMode(), pgstat_get_entry_ref_locked(), PGSTAT_KIND_REPLSLOT, pgstat_unlock_entry(), ReplicationSlotIndex(), and PgStat_EntryRef::shared_stats.
Referenced by ReplicationSlotCreate().
Definition at line 77 of file pgstat_subscription.c.
References fb(), InvalidOid, pgstat_create_transactional(), pgstat_get_entry_ref(), PGSTAT_KIND_SUBSCRIPTION, and pgstat_reset_entry().
Referenced by CreateSubscription().
Definition at line 519 of file pgstat.c.
References DEBUG2, elog, ereport, errcode_for_file_access(), errmsg(), errmsg_internal(), fb(), LOG, pgstat_get_kind_info(), PgStat_Kind, PGSTAT_KIND_MAX, PGSTAT_KIND_MIN, pgstat_reset_after_failure(), PGSTAT_STAT_PERMANENT_FILENAME, and STATS_DISCARD.
Referenced by StartupXLOG().
Definition at line 44 of file pgstat_database.c.
References fb(), InvalidOid, pgstat_drop_transactional(), and PGSTAT_KIND_DATABASE.
Referenced by dropdb().
Definition at line 60 of file pgstat_function.c.
References fb(), MyDatabaseId, pgstat_drop_transactional(), and PGSTAT_KIND_FUNCTION.
Referenced by RemoveFunctionById().
Definition at line 179 of file pgstat_relation.c.
References GetCurrentTransactionNestLevel(), InvalidOid, MyDatabaseId, PgStat_TableXactStatus::nest_level, pgstat_drop_transactional(), RelationData::pgstat_info, PGSTAT_KIND_RELATION, pgstat_should_count_relation, RelationData::rd_rel, RelationGetRelid, save_truncdrop_counters(), PgStat_TableStatus::trans, PgStat_TableXactStatus::tuples_deleted, PgStat_TableXactStatus::tuples_inserted, and PgStat_TableXactStatus::tuples_updated.
Referenced by heap_drop_with_catalog(), and index_drop().
|
extern |
Definition at line 186 of file pgstat_replslot.c.
References Assert, fb(), InvalidOid, LW_EXCLUSIVE, LWLockHeldByMeInMode(), pgstat_drop_entry(), PGSTAT_KIND_REPLSLOT, pgstat_request_entry_refs_gc(), and ReplicationSlotIndex().
Referenced by ReplicationSlotDropPtr().
Definition at line 95 of file pgstat_subscription.c.
References InvalidOid, pgstat_drop_transactional(), and PGSTAT_KIND_SUBSCRIPTION.
Referenced by DropSubscription().
|
extern |
Definition at line 146 of file pgstat_function.c.
References fb(), INSTR_TIME_ADD, INSTR_TIME_SET_CURRENT, INSTR_TIME_SUBTRACT, PgStat_FunctionCounts::numcalls, PgStat_FunctionCounts::self_time, total_func_time, and PgStat_FunctionCounts::total_time.
Referenced by call_pltcl_start_proc(), EventTriggerInvoke(), ExecCallTriggerFunc(), ExecEvalFuncExprFusage(), ExecEvalFuncExprStrictFusage(), ExecMakeFunctionResultSet(), ExecMakeTableFunctionResult(), ExecuteCallStmt(), and fmgr_security_definer().
|
extern |
Definition at line 314 of file pgstat_xact.c.
References fb(), i, items, pgstat_drop_entry(), and pgstat_request_entry_refs_gc().
Referenced by FinishPreparedTransaction(), xact_redo_abort(), and xact_redo_commit().
|
extern |
Definition at line 200 of file pgstat_replslot.c.
References fb(), get_replslot_index(), idx(), InvalidOid, LW_SHARED, LWLockAcquire(), LWLockRelease(), NameStr, pgstat_fetch_entry(), and PGSTAT_KIND_REPLSLOT.
Referenced by pg_stat_get_replication_slot().
|
extern |
Definition at line 91 of file pgstat_slru.c.
References PGSTAT_KIND_SLRU, pgstat_snapshot_fixed(), pgStatLocal, PgStat_Snapshot::slru, and PgStat_LocalState::snapshot.
Referenced by pg_stat_get_slru().
|
extern |
Definition at line 58 of file pgstat_archiver.c.
References PgStat_Snapshot::archiver, PGSTAT_KIND_ARCHIVER, pgstat_snapshot_fixed(), pgStatLocal, and PgStat_LocalState::snapshot.
Referenced by pg_stat_get_archiver().
|
extern |
Definition at line 93 of file pgstat_backend.c.
References fb(), InvalidOid, pgstat_fetch_entry(), and PGSTAT_KIND_BACKEND.
Referenced by pgstat_fetch_stat_backend_by_pid().
|
extern |
Definition at line 111 of file pgstat_backend.c.
References AuxiliaryPidGetProc(), B_INVALID, BackendPidGetProc(), fb(), GetNumberFromPGProc, pgstat_fetch_stat_backend(), pgstat_get_beentry_by_proc_number(), and pgstat_tracks_backend_bktype().
Referenced by pg_stat_get_backend_io(), and pg_stat_get_backend_wal().
|
extern |
Definition at line 72 of file pgstat_bgwriter.c.
References PgStat_Snapshot::bgwriter, PGSTAT_KIND_BGWRITER, pgstat_snapshot_fixed(), pgStatLocal, and PgStat_LocalState::snapshot.
Referenced by pg_stat_get_bgwriter_buf_written_clean(), pg_stat_get_bgwriter_maxwritten_clean(), pg_stat_get_bgwriter_stat_reset_time(), and pg_stat_get_buf_alloc().
|
extern |
Definition at line 81 of file pgstat_checkpointer.c.
References PgStat_Snapshot::checkpointer, PGSTAT_KIND_CHECKPOINTER, pgstat_snapshot_fixed(), pgStatLocal, and PgStat_LocalState::snapshot.
Referenced by pg_stat_get_checkpointer_buffers_written(), pg_stat_get_checkpointer_num_performed(), pg_stat_get_checkpointer_num_requested(), pg_stat_get_checkpointer_num_timed(), pg_stat_get_checkpointer_restartpoints_performed(), pg_stat_get_checkpointer_restartpoints_requested(), pg_stat_get_checkpointer_restartpoints_timed(), pg_stat_get_checkpointer_slru_written(), pg_stat_get_checkpointer_stat_reset_time(), pg_stat_get_checkpointer_sync_time(), and pg_stat_get_checkpointer_write_time().
|
extern |
Definition at line 278 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().
|
extern |
Definition at line 245 of file pgstat_function.c.
References fb(), MyDatabaseId, pgstat_fetch_entry(), and PGSTAT_KIND_FUNCTION.
Referenced by pg_stat_get_function_calls(), and pg_stat_get_function_stat_reset_time().
Definition at line 164 of file pgstat_io.c.
References PgStat_Snapshot::io, PGSTAT_KIND_IO, pgstat_snapshot_fixed(), pgStatLocal, and PgStat_LocalState::snapshot.
Referenced by pg_stat_get_io().
|
extern |
Definition at line 106 of file pgstat_subscription.c.
References InvalidOid, pgstat_fetch_entry(), and PGSTAT_KIND_SUBSCRIPTION.
Referenced by pg_stat_get_subscription_stats().
|
extern |
Definition at line 469 of file pgstat_relation.c.
References IsSharedRelation(), and pgstat_fetch_stat_tabentry_ext().
|
extern |
Definition at line 479 of file pgstat_relation.c.
References InvalidOid, MyDatabaseId, pgstat_fetch_entry(), and PGSTAT_KIND_RELATION.
Referenced by do_autovacuum(), pgstat_copy_relation_stats(), pgstat_fetch_stat_tabentry(), and recheck_relation_needs_vacanalyze().
|
extern |
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().
Definition at line 824 of file pgstat.c.
References pgStatForceNextFlush.
Referenced by pg_stat_force_next_flush().
Definition at line 240 of file pgstat_io.c.
References elog, ERROR, fb(), IOCONTEXT_BULKREAD, IOCONTEXT_BULKWRITE, IOCONTEXT_INIT, IOCONTEXT_NORMAL, IOCONTEXT_VACUUM, and pg_unreachable.
Referenced by pg_stat_io_build_tuples().
Definition at line 261 of file pgstat_io.c.
References elog, ERROR, fb(), IOOBJECT_RELATION, IOOBJECT_TEMP_RELATION, IOOBJECT_WAL, and pg_unreachable.
Referenced by pg_stat_io_build_tuples().
|
extern |
Definition at line 1411 of file pgstat.c.
References ereport, errcode(), errmsg(), ERROR, fb(), idx(), name, pg_strcasecmp(), PgStat_Kind, pgstat_kind_builtin_infos, PGSTAT_KIND_BUILTIN_MAX, PGSTAT_KIND_BUILTIN_MIN, pgstat_kind_custom_infos, PGSTAT_KIND_CUSTOM_MAX, PGSTAT_KIND_CUSTOM_MIN, and PGSTAT_KIND_INVALID.
Referenced by pg_stat_have_stats().
Definition at line 118 of file pgstat_slru.c.
References fb(), i, name, slru_names, and SLRU_NUM_ELEMENTS.
Referenced by pgstat_reset_slru(), and SimpleLruInit().
Definition at line 104 of file pgstat_slru.c.
References fb(), slru_names, and SLRU_NUM_ELEMENTS.
Referenced by pg_stat_get_slru().
|
extern |
Definition at line 1037 of file pgstat.c.
References fb(), force_stats_snapshot_clear, PgStat_Snapshot::mode, pgstat_clear_snapshot(), PGSTAT_FETCH_CONSISTENCY_SNAPSHOT, pgStatLocal, PgStat_LocalState::snapshot, and PgStat_Snapshot::snapshot_timestamp.
Referenced by pg_stat_get_snapshot_timestamp().
|
extern |
Definition at line 272 of file pgstat_xact.c.
References Assert, dlist_iter::cur, dclist_container, dclist_count(), dclist_foreach, fb(), PgStat_PendingDroppedStatsItem::is_create, PgStat_PendingDroppedStatsItem::item, items, PgStat_SubXactStatus::nest_level, nitems, palloc(), PgStat_SubXactStatus::pending_drops, pgStatXactStack, and PgStat_SubXactStatus::prev.
Referenced by RecordTransactionAbort(), RecordTransactionCommit(), and StartPrepare().
|
extern |
Definition at line 1054 of file pgstat.c.
References fb(), pgstat_get_entry_ref(), and pgstat_get_kind_info().
Referenced by pg_stat_have_stats().
|
extern |
Definition at line 91 of file pgstat_relation.c.
References fb(), RelationData::pgstat_enabled, RelationData::pgstat_info, pgstat_track_counts, pgstat_unlink_relation(), and RelationData::rd_rel.
Referenced by relation_open(), and try_relation_open().
Definition at line 651 of file pgstat.c.
References Assert, before_shmem_exit(), fb(), pgstat_attach_shmem(), pgstat_get_kind_info(), pgstat_init_snapshot_fixed(), PgStat_Kind, PGSTAT_KIND_MAX, PGSTAT_KIND_MIN, and pgstat_shutdown_hook().
Referenced by BaseInit().
|
extern |
Definition at line 91 of file pgstat_io.c.
References fb(), INSTR_TIME_SET_CURRENT, and INSTR_TIME_SET_ZERO.
Referenced by AsyncReadBuffers(), ExtendBufferedRelLocal(), ExtendBufferedRelShared(), FlushBuffer(), FlushLocalBuffer(), issue_xlog_fsync(), IssuePendingWritebacks(), mdsyncfiletag(), register_dirty_segment(), WaitReadBuffers(), WALRead(), XLogFileInitInternal(), XLogPageRead(), XLogWalRcvWrite(), and XLogWrite().
Definition at line 145 of file pgstat_database.c.
References Assert, CritSectionCount, fb(), InvalidOid, pgstat_get_entry_ref(), and PGSTAT_KIND_DATABASE.
Referenced by AsyncReadBuffers(), read_rel_block_ll(), RelationCopyStorage(), and sendFile().
|
extern |
Definition at line 281 of file pgstat_relation.c.
References AmAutoVacuumWorkerProcess, Assert, PgStat_TableStatus::counts, PgStat_TableCounts::delta_dead_tuples, fb(), GetCurrentTimestamp(), InvalidOid, Max, MyDatabaseId, PGSTAT_BACKEND_FLUSH_IO, pgstat_flush_backend(), pgstat_flush_io(), pgstat_get_entry_ref_locked(), RelationData::pgstat_info, PGSTAT_KIND_RELATION, pgstat_should_count_relation, pgstat_track_counts, pgstat_unlock_entry(), RelationData::rd_rel, RelationGetRelid, PgStat_EntryRef::shared_stats, TimestampDifferenceMilliseconds(), PgStat_TableStatus::trans, trans, and PgStat_TableXactStatus::tuples_inserted.
Referenced by do_analyze_rel().
Definition at line 28 of file pgstat_archiver.c.
References PgStat_ShmemControl::archiver, fb(), GetCurrentTimestamp(), now(), pgstat_begin_changecount_write(), pgstat_end_changecount_write(), pgStatLocal, and PgStat_LocalState::shmem.
Referenced by pgarch_ArchiverCopyLoop().
Definition at line 55 of file pgstat_database.c.
References Assert, fb(), GetCurrentTimestamp(), InvalidOid, IsUnderPostmaster, pgstat_get_entry_ref_locked(), PGSTAT_KIND_DATABASE, pgstat_unlock_entry(), and PgStat_EntryRef::shared_stats.
Referenced by AutoVacWorkerMain().
Definition at line 31 of file pgstat_bgwriter.c.
References Assert, PgStat_ShmemControl::bgwriter, BGWRITER_ACC, fb(), PgStat_ShmemControl::is_shutdown, MemSet, PendingBgWriterStats, pg_memory_is_all_zeros(), pgstat_assert_is_up, pgstat_begin_changecount_write(), pgstat_end_changecount_write(), pgstat_flush_io(), pgStatLocal, and PgStat_LocalState::shmem.
Referenced by BackgroundWriterMain().
Definition at line 31 of file pgstat_checkpointer.c.
References Assert, PgStat_ShmemControl::checkpointer, CHECKPOINTER_ACC, fb(), PgStat_ShmemControl::is_shutdown, MemSet, PendingCheckpointerStats, pg_memory_is_all_zeros(), pgstat_assert_is_up, pgstat_begin_changecount_write(), pgstat_end_changecount_write(), pgstat_flush_io(), pgStatLocal, and PgStat_LocalState::shmem.
Referenced by CheckpointerMain(), and CheckpointWriteDelay().
Definition at line 166 of file pgstat_database.c.
References Assert, elog, fb(), GetCurrentTimestamp(), InvalidOid, pgstat_get_entry_ref(), PGSTAT_KIND_DATABASE, pgstat_lock_entry(), pgstat_track_counts, pgstat_unlock_entry(), PgStat_EntryRef::shared_stats, and WARNING.
Referenced by buffer_readv_complete(), RelationCopyStorage(), sendFile(), and shared_buffer_readv_complete_local().
Definition at line 227 of file pgstat_database.c.
References fb(), MyDatabaseId, MyStartTimestamp, pgLastSessionReportTime, pgstat_prep_database_pending(), and pgstat_should_report_connstat().
Referenced by PostgresMain().
Definition at line 125 of file pgstat_database.c.
References fb(), MyDatabaseId, pgstat_prep_database_pending(), and pgstat_track_counts.
Referenced by DeadLockReport().
Definition at line 81 of file pgstat_database.c.
References Assert, fb(), 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().
|
extern |
Definition at line 77 of file pgstat_replslot.c.
References fb(), InvalidOid, pgstat_get_entry_ref_locked(), PGSTAT_KIND_REPLSLOT, pgstat_unlock_entry(), ReplicationSlotIndex(), REPLSLOT_ACC, and PgStat_EntryRef::shared_stats.
Referenced by UpdateDecodingStats().
|
extern |
Definition at line 111 of file pgstat_replslot.c.
References Assert, ReplicationSlot::data, fb(), GetCurrentTimestamp(), InvalidOid, pgstat_get_entry_ref_locked(), PGSTAT_KIND_REPLSLOT, pgstat_unlock_entry(), RecoveryInProgress(), ReplicationSlotIndex(), PgStat_EntryRef::shared_stats, and ReplicationSlotPersistentData::synced.
Referenced by update_slotsync_skip_stats().
Definition at line 704 of file pgstat.c.
References Assert, dlist_is_empty(), fb(), GetCurrentTimestamp(), GetCurrentTransactionStopTimestamp(), PgStat_ShmemControl::is_shutdown, IsTransactionOrTransactionBlock(), now(), pgstat_assert_is_up, pgstat_flush_pending_entries(), pgstat_get_kind_info(), PGSTAT_IDLE_INTERVAL, PgStat_Kind, PGSTAT_KIND_MAX, PGSTAT_KIND_MIN, PGSTAT_MAX_INTERVAL, PGSTAT_MIN_INTERVAL, pgstat_report_fixed, pgstat_update_dbstats(), pgStatForceNextFlush, pgStatLocal, pgStatPending, PgStat_LocalState::shmem, and TimestampDifferenceExceeds().
Referenced by AllTablesyncsReady(), apply_handle_commit_internal(), apply_handle_commit_prepared(), apply_handle_prepare(), apply_handle_rollback_prepared(), apply_handle_stream_prepare(), FinishSyncWorker(), HasSubscriptionTablesCached(), LogicalRepApplyLoop(), LogicalRepSyncTableStart(), pgstat_before_server_shutdown(), pgstat_shutdown_hook(), PostgresMain(), ProcessInterrupts(), ProcessSequencesForSync(), ProcessSyncingTablesForApply(), ProcessSyncingTablesForSync(), standby_redo(), and worker_spi_main().
|
extern |
Definition at line 62 of file pgstat_subscription.c.
References PgStat_BackendSubEntry::conflict_count, fb(), InvalidOid, PgStat_EntryRef::pending, PGSTAT_KIND_SUBSCRIPTION, pgstat_prep_pending_entry(), and type.
Referenced by ReportApplyConflict().
|
extern |
Definition at line 28 of file pgstat_subscription.c.
References PgStat_BackendSubEntry::apply_error_count, Assert, fb(), InvalidOid, PgStat_EntryRef::pending, PGSTAT_KIND_SUBSCRIPTION, pgstat_prep_pending_entry(), PgStat_BackendSubEntry::sync_seq_error_count, PgStat_BackendSubEntry::sync_table_error_count, WORKERTYPE_APPLY, WORKERTYPE_SEQUENCESYNC, and WORKERTYPE_TABLESYNC.
Referenced by DisableSubscriptionAndExit(), start_apply(), start_sequence_sync(), and start_table_sync().
|
extern |
Definition at line 210 of file pgstat_relation.c.
References AmAutoVacuumWorkerProcess, fb(), GetCurrentTimestamp(), InvalidOid, MyDatabaseId, PGSTAT_BACKEND_FLUSH_IO, pgstat_flush_backend(), pgstat_flush_io(), pgstat_get_entry_ref_locked(), PGSTAT_KIND_RELATION, pgstat_track_counts, pgstat_unlock_entry(), RelationData::rd_rel, RelationGetRelid, PgStat_EntryRef::shared_stats, and TimestampDifferenceMilliseconds().
Referenced by heap_vacuum_rel().
Definition at line 46 of file pgstat_wal.c.
References fb(), PGSTAT_BACKEND_FLUSH_IO, PGSTAT_BACKEND_FLUSH_WAL, pgstat_flush_backend(), pgstat_flush_io(), and pgstat_wal_flush_cb().
Referenced by BackgroundWriterMain(), CheckpointerMain(), summarizer_wait_for_wal(), WalReceiverMain(), and WalWriterMain().
|
extern |
Definition at line 864 of file pgstat.c.
References Assert, fb(), GetCurrentTimestamp(), pgstat_get_kind_info(), pgstat_reset_database_timestamp(), and pgstat_reset_entry().
Referenced by pg_stat_reset_backend_stats(), pg_stat_reset_single_function_counters(), pg_stat_reset_single_table_counters(), pg_stat_reset_subscription_stats(), pgstat_create_transactional(), and pgstat_reset_replslot().
Definition at line 845 of file pgstat.c.
References GetCurrentTimestamp(), match_db_entries(), MyDatabaseId, ObjectIdGetDatum(), and pgstat_reset_matching_entries().
Referenced by pg_stat_reset().
|
extern |
Definition at line 886 of file pgstat.c.
References fb(), GetCurrentTimestamp(), pgstat_get_kind_info(), and pgstat_reset_entries_of_kind().
Referenced by pg_stat_reset_replication_slot(), pg_stat_reset_shared(), pg_stat_reset_slru(), pg_stat_reset_subscription_stats(), test_custom_stats_fixed_reset(), and test_custom_stats_var_from_serialized_data().
Definition at line 42 of file pgstat_replslot.c.
References Assert, ereport, errcode(), errmsg(), ERROR, fb(), InvalidOid, LW_SHARED, LWLockAcquire(), LWLockRelease(), name, PGSTAT_KIND_REPLSLOT, pgstat_reset(), ReplicationSlotIndex(), SearchNamedReplicationSlot(), and SlotIsLogical.
Referenced by pg_stat_reset_replication_slot().
Definition at line 45 of file pgstat_slru.c.
References Assert, fb(), GetCurrentTimestamp(), name, pgstat_get_slru_index(), and pgstat_reset_slru_counter_internal().
Referenced by pg_stat_reset_slru().
Definition at line 507 of file pgstat.c.
References pgstat_read_statsfile().
Referenced by StartupXLOG().
|
extern |
Definition at line 366 of file pgstat_backend.c.
References B_ARCHIVER, B_AUTOVAC_LAUNCHER, B_AUTOVAC_WORKER, B_BACKEND, B_BG_WORKER, B_BG_WRITER, B_CHECKPOINTER, B_DEAD_END_BACKEND, B_INVALID, B_IO_WORKER, B_LOGGER, B_SLOTSYNC_WORKER, B_STANDALONE_BACKEND, B_STARTUP, B_WAL_RECEIVER, B_WAL_SENDER, B_WAL_SUMMARIZER, B_WAL_WRITER, and fb().
Referenced by pg_stat_reset_backend_stats(), pgstat_bestart_final(), pgstat_count_backend_io_op(), pgstat_count_backend_io_op_time(), pgstat_fetch_stat_backend_by_pid(), and pgstat_flush_backend().
|
extern |
Definition at line 351 of file pgstat_io.c.
References B_ARCHIVER, B_AUTOVAC_LAUNCHER, B_AUTOVAC_WORKER, B_BACKEND, B_BG_WORKER, B_BG_WRITER, B_CHECKPOINTER, B_DEAD_END_BACKEND, B_INVALID, B_IO_WORKER, B_LOGGER, B_SLOTSYNC_WORKER, B_STANDALONE_BACKEND, B_STARTUP, B_WAL_RECEIVER, B_WAL_SENDER, B_WAL_SUMMARIZER, B_WAL_WRITER, and fb().
Referenced by pg_stat_get_io(), and pgstat_tracks_io_object().
|
extern |
Definition at line 393 of file pgstat_io.c.
References B_AUTOVAC_LAUNCHER, B_AUTOVAC_WORKER, B_BG_WRITER, B_CHECKPOINTER, B_STANDALONE_BACKEND, B_STARTUP, B_WAL_RECEIVER, B_WAL_SUMMARIZER, B_WAL_WRITER, fb(), IOCONTEXT_BULKREAD, IOCONTEXT_BULKWRITE, IOCONTEXT_INIT, IOCONTEXT_NORMAL, IOCONTEXT_VACUUM, IOOBJECT_TEMP_RELATION, IOOBJECT_WAL, and pgstat_tracks_io_bktype().
Referenced by pg_stat_io_build_tuples(), and pgstat_tracks_io_op().
|
extern |
Definition at line 477 of file pgstat_io.c.
References B_AUTOVAC_LAUNCHER, B_AUTOVAC_WORKER, B_BG_WRITER, B_CHECKPOINTER, B_WAL_RECEIVER, B_WAL_WRITER, fb(), IOCONTEXT_BULKREAD, IOCONTEXT_BULKWRITE, IOCONTEXT_INIT, IOCONTEXT_NORMAL, IOCONTEXT_VACUUM, IOOBJECT_TEMP_RELATION, IOOBJECT_WAL, IOOP_EVICT, IOOP_EXTEND, IOOP_FSYNC, IOOP_HIT, IOOP_READ, IOOP_REUSE, IOOP_WRITE, IOOP_WRITEBACK, and pgstat_tracks_io_object().
Referenced by pg_stat_io_build_tuples(), pgstat_bktype_io_stats_valid(), pgstat_count_backend_io_op(), pgstat_count_backend_io_op_time(), and pgstat_count_io_op().
|
extern |
Definition at line 782 of file pgstat_relation.c.
References PgStat_TableStatus::counts, TwoPhasePgStatRecord::deleted_pre_truncdrop, PgStat_TableCounts::delta_dead_tuples, fb(), TwoPhasePgStatRecord::id, TwoPhasePgStatRecord::inserted_pre_truncdrop, pgstat_prep_relation_pending(), TwoPhasePgStatRecord::shared, TwoPhasePgStatRecord::truncdropped, TwoPhasePgStatRecord::tuples_deleted, PgStat_TableCounts::tuples_deleted, TwoPhasePgStatRecord::tuples_inserted, PgStat_TableCounts::tuples_inserted, TwoPhasePgStatRecord::tuples_updated, PgStat_TableCounts::tuples_updated, and TwoPhasePgStatRecord::updated_pre_truncdrop.
|
extern |
Definition at line 746 of file pgstat_relation.c.
References PgStat_TableCounts::changed_tuples, PgStat_TableStatus::counts, PgStat_TableCounts::delta_dead_tuples, PgStat_TableCounts::delta_live_tuples, fb(), TwoPhasePgStatRecord::id, pgstat_prep_relation_pending(), TwoPhasePgStatRecord::shared, TwoPhasePgStatRecord::truncdropped, PgStat_TableCounts::truncdropped, TwoPhasePgStatRecord::tuples_deleted, PgStat_TableCounts::tuples_deleted, TwoPhasePgStatRecord::tuples_inserted, PgStat_TableCounts::tuples_inserted, TwoPhasePgStatRecord::tuples_updated, and PgStat_TableCounts::tuples_updated.
Definition at line 152 of file pgstat_relation.c.
References Assert, fb(), RelationData::pgstat_info, and PgStat_TableStatus::relation.
Referenced by pgstat_init_relation(), pgstat_relation_delete_pending_cb(), and RelationDestroyRelation().
Definition at line 452 of file pgstat_relation.c.
References PgStat_TableStatus::counts, PgStat_TableCounts::delta_dead_tuples, RelationData::pgstat_info, and pgstat_should_count_relation.
Referenced by heap_page_prune_opt().
|
extern |
Definition at line 305 of file pgstat_database.c.
References fb(), MyDatabaseId, OidIsValid, and pgstat_prep_database_pending().
Referenced by standard_ExecutorEnd().
Definition at line 211 of file pgstat_xact.c.
References Assert, fb(), PgStat_SubXactStatus::nest_level, pgstat_clear_snapshot(), pgStatXactStack, PostPrepare_PgStat_Relations(), and PgStat_SubXactStatus::prev.
Referenced by PrepareTransaction().
Definition at line 156 of file pgstat_shmem.c.
References Assert, ctl, dsa_create_in_place, dsa_detach(), dsa_pin(), dsa_set_size_limit(), dsh_params, dshash_create(), dshash_detach(), dshash_get_hash_table_handle(), fb(), idx(), IsUnderPostmaster, MAXALIGN, pg_atomic_init_u64(), pgstat_dsa_init_size(), pgstat_get_kind_info(), pgstat_is_kind_builtin(), PgStat_Kind, PGSTAT_KIND_CUSTOM_MIN, PGSTAT_KIND_MAX, PGSTAT_KIND_MIN, pgStatLocal, PgStat_LocalState::shmem, ShmemAlloc(), ShmemInitStruct(), and StatsShmemSize().
Referenced by CreateOrAttachShmemStructs().
Definition at line 127 of file pgstat_shmem.c.
References add_size(), Assert, fb(), MAXALIGN, pgstat_dsa_init_size(), pgstat_get_kind_info(), PgStat_Kind, PGSTAT_KIND_CUSTOM_MAX, and PGSTAT_KIND_CUSTOM_MIN.
Referenced by CalculateShmemSize(), and StatsShmemInit().
|
extern |
Definition at line 24 of file pgstat_bgwriter.c.
Referenced by BgBufferSync(), and pgstat_report_bgwriter().
|
extern |
Definition at line 24 of file pgstat_checkpointer.c.
Referenced by BufferSync(), CheckpointerMain(), LogCheckpointEnd(), pgstat_report_checkpointer(), and SlruInternalWritePage().
|
extern |
Definition at line 204 of file pgstat.c.
Referenced by assign_stats_fetch_consistency(), pgstat_build_snapshot(), pgstat_build_snapshot_fixed(), pgstat_fetch_entry(), pgstat_prep_snapshot(), pgstat_snapshot_fixed(), and pgstat_write_statsfile().
|
extern |
Definition at line 203 of file pgstat.c.
Referenced by autovac_init(), AutoVacuumingActive(), pgstat_init_relation(), pgstat_report_analyze(), pgstat_report_checksum_failures_in_db(), pgstat_report_deadlock(), pgstat_report_recovery_conflict(), pgstat_report_tempfile(), and pgstat_report_vacuum().
|
extern |
Definition at line 30 of file pgstat_function.c.
|
extern |
Definition at line 30 of file pgstat_database.c.
Referenced by pgstat_update_dbstats().
|
extern |
Definition at line 28 of file pgstat_database.c.
Referenced by do_analyze_rel(), heap_vacuum_rel(), and pgstat_update_dbstats().
|
extern |
Definition at line 29 of file pgstat_database.c.
Referenced by do_analyze_rel(), heap_vacuum_rel(), and pgstat_update_dbstats().
|
extern |
Definition at line 32 of file pgstat_database.c.
Referenced by die(), errfinish(), pgstat_report_disconnect(), and PostgresMain().
|
extern |
Definition at line 31 of file pgstat_database.c.
Referenced by pgstat_update_dbstats().