PostgreSQL Source Code
git master
|
#include "access/xlogdefs.h"
#include "datatype/timestamp.h"
#include "portability/instr_time.h"
#include "postmaster/pgarch.h"
#include "replication/conflict.h"
#include "utils/backend_progress.h"
#include "utils/backend_status.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_IO |
struct | PgStat_StatDBEntry |
struct | PgStat_StatFuncEntry |
struct | PgStat_StatReplSlotEntry |
struct | PgStat_SLRUStats |
struct | PgStat_StatSubEntry |
struct | PgStat_StatTabEntry |
struct | PgStat_WalStats |
struct | PgStat_PendingWalStats |
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 } |
enum | IOContext { IOCONTEXT_BULKREAD , IOCONTEXT_BULKWRITE , IOCONTEXT_NORMAL , IOCONTEXT_VACUUM } |
enum | IOOp { IOOP_EVICT , IOOP_EXTEND , IOOP_FSYNC , IOOP_HIT , IOOP_READ , IOOP_REUSE , IOOP_WRITE , IOOP_WRITEBACK } |
#define IOCONTEXT_NUM_TYPES (IOCONTEXT_VACUUM + 1) |
#define IOOBJECT_NUM_TYPES (IOOBJECT_TEMP_RELATION + 1) |
#define IOOP_NUM_TYPES (IOOP_WRITEBACK + 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_KIND_BUILTIN_MAX PGSTAT_KIND_WAL |
#define PGSTAT_KIND_BUILTIN_MIN PGSTAT_KIND_DATABASE |
#define PGSTAT_KIND_BUILTIN_SIZE (PGSTAT_KIND_BUILTIN_MAX + 1) |
#define PGSTAT_KIND_CUSTOM_MAX PGSTAT_KIND_MAX |
#define PGSTAT_KIND_CUSTOM_SIZE (PGSTAT_KIND_CUSTOM_MAX - PGSTAT_KIND_CUSTOM_MIN + 1) |
#define PGSTAT_KIND_DATABASE 1 /* database-wide statistics */ |
#define PGSTAT_KIND_FUNCTION 3 /* per-function statistics */ |
#define PGSTAT_KIND_SUBSCRIPTION 5 /* per-subscription statistics */ |
#define pgstat_should_count_relation | ( | rel | ) |
#define PGSTAT_STAT_PERMANENT_FILENAME "pg_stat/pgstat.stat" |
typedef struct PgStat_ArchiverStats PgStat_ArchiverStats |
typedef struct PgStat_BackendSubEntry PgStat_BackendSubEntry |
typedef struct PgStat_BgWriterStats PgStat_BgWriterStats |
typedef struct PgStat_BktypeIO PgStat_BktypeIO |
typedef struct PgStat_CheckpointerStats PgStat_CheckpointerStats |
typedef int64 PgStat_Counter |
typedef enum PgStat_FetchConsistency PgStat_FetchConsistency |
typedef struct PgStat_FunctionCallUsage PgStat_FunctionCallUsage |
typedef struct PgStat_FunctionCounts PgStat_FunctionCounts |
typedef struct PgStat_PendingWalStats PgStat_PendingWalStats |
typedef struct PgStat_SLRUStats PgStat_SLRUStats |
typedef struct PgStat_StatDBEntry PgStat_StatDBEntry |
typedef struct PgStat_StatFuncEntry PgStat_StatFuncEntry |
typedef struct PgStat_StatReplSlotEntry PgStat_StatReplSlotEntry |
typedef struct PgStat_StatSubEntry PgStat_StatSubEntry |
typedef struct PgStat_StatTabEntry PgStat_StatTabEntry |
typedef struct PgStat_TableCounts PgStat_TableCounts |
typedef struct PgStat_TableStatus PgStat_TableStatus |
typedef struct PgStat_TableXactStatus PgStat_TableXactStatus |
typedef struct PgStat_WalStats PgStat_WalStats |
typedef enum SessionEndType SessionEndType |
typedef enum TrackFunctionsLevel TrackFunctionsLevel |
enum IOContext |
enum IOObject |
enum IOOp |
enum SessionEndType |
enum TrackFunctionsLevel |
void AtEOSubXact_PgStat | ( | bool | isCommit, |
int | nestDepth | ||
) |
Definition at line 113 of file pgstat_xact.c.
References AtEOSubXact_PgStat_DroppedStats(), AtEOSubXact_PgStat_Relations(), 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(), PgStat_SubXactStatus::nest_level, pgstat_clear_snapshot(), pgStatXactStack, and PgStat_SubXactStatus::prev.
Referenced by AbortTransaction(), CommitTransaction(), and FinishPreparedTransaction().
void AtPrepare_PgStat | ( | void | ) |
Definition at line 191 of file pgstat_xact.c.
References Assert, AtPrepare_PgStat_Relations(), PgStat_SubXactStatus::nest_level, pgStatXactStack, and PgStat_SubXactStatus::prev.
Referenced by PrepareTransaction().
PgStat_FunctionCounts* find_funcstat_entry | ( | Oid | func_id | ) |
Definition at line 223 of file pgstat_function.c.
References MyDatabaseId, PgStat_EntryRef::pending, pgstat_fetch_pending_entry(), and PGSTAT_KIND_FUNCTION.
Referenced by pg_stat_get_xact_function_calls().
PgStat_TableStatus* find_tabstat_entry | ( | Oid | rel_id | ) |
Definition at line 487 of file pgstat_relation.c.
References PgStat_TableStatus::counts, InvalidOid, MyDatabaseId, palloc(), PgStat_EntryRef::pending, pgstat_fetch_pending_entry(), PGSTAT_KIND_RELATION, PgStat_TableStatus::trans, trans, PgStat_TableCounts::tuples_deleted, PgStat_TableCounts::tuples_inserted, and PgStat_TableCounts::tuples_updated.
void pgstat_acquire_replslot | ( | struct ReplicationSlot * | slot | ) |
Definition at line 146 of file pgstat_replslot.c.
References InvalidOid, pgstat_get_entry_ref(), PGSTAT_KIND_REPLSLOT, and ReplicationSlotIndex().
Referenced by ReplicationSlotAcquire().
void pgstat_assoc_relation | ( | Relation | rel | ) |
Definition at line 132 of file pgstat_relation.c.
References Assert, RelationData::pgstat_enabled, RelationData::pgstat_info, pgstat_prep_relation_pending(), RelationData::rd_rel, PgStat_TableStatus::relation, and RelationGetRelid.
void pgstat_before_server_shutdown | ( | int | code, |
Datum | arg | ||
) |
Definition at line 532 of file pgstat.c.
References Assert, GetRedoRecPtr(), PgStat_ShmemControl::is_shutdown, pgstat_report_stat(), pgstat_write_statsfile(), pgStatLocal, and PgStat_LocalState::shmem.
Referenced by CheckpointerMain(), and InitPostgres().
bool pgstat_bktype_io_stats_valid | ( | PgStat_BktypeIO * | backend_io, |
BackendType | bktype | ||
) |
Definition at line 46 of file pgstat_io.c.
References PgStat_BktypeIO::counts, IOCONTEXT_NUM_TYPES, IOOBJECT_NUM_TYPES, IOOP_NUM_TYPES, pgstat_tracks_io_op(), and PgStat_BktypeIO::times.
Referenced by pg_stat_get_io(), and pgstat_io_flush_cb().
void pgstat_clear_snapshot | ( | void | ) |
Definition at line 896 of file pgstat.c.
References PgStat_Snapshot::context, PgStat_Snapshot::custom_valid, 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 58 of file pgstat_relation.c.
References InvalidOid, MyDatabaseId, pgstat_fetch_stat_tabentry_ext(), pgstat_get_entry_ref_locked(), PGSTAT_KIND_RELATION, pgstat_unlock_entry(), RelationData::rd_rel, RelationGetRelid, PgStat_EntryRef::shared_stats, and PgStatShared_Relation::stats.
Referenced by index_concurrently_swap().
void pgstat_count_heap_delete | ( | Relation | rel | ) |
Definition at line 401 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().
void pgstat_count_heap_insert | ( | Relation | rel, |
PgStat_Counter | n | ||
) |
Definition at line 360 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 375 of file pgstat_relation.c.
References Assert, PgStat_TableStatus::counts, ensure_tabstat_xact_level(), 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().
Definition at line 77 of file pgstat_io.c.
References pgstat_count_io_op_n().
Referenced by GetLocalVictimBuffer(), GetVictimBuffer(), and PinBufferForBlock().
Definition at line 83 of file pgstat_io.c.
References Assert, PgStat_PendingIO::counts, have_iostats, IOCONTEXT_NUM_TYPES, IOOBJECT_NUM_TYPES, IOOP_NUM_TYPES, MyBackendType, PendingIOStats, and pgstat_tracks_io_op().
Referenced by pgstat_count_io_op(), and pgstat_count_io_op_time().
void pgstat_count_io_op_time | ( | IOObject | io_object, |
IOContext | io_context, | ||
IOOp | io_op, | ||
instr_time | start_time, | ||
uint32 | cnt | ||
) |
Definition at line 122 of file pgstat_io.c.
References INSTR_TIME_ADD, INSTR_TIME_GET_MICROSEC, INSTR_TIME_SET_CURRENT, INSTR_TIME_SUBTRACT, IOOBJECT_RELATION, IOOBJECT_TEMP_RELATION, IOOP_EXTEND, IOOP_READ, IOOP_WRITE, BufferUsage::local_blk_read_time, BufferUsage::local_blk_write_time, PgStat_PendingIO::pending_times, PendingIOStats, pgBufferUsage, pgstat_count_buffer_read_time, pgstat_count_buffer_write_time, pgstat_count_io_op_n(), BufferUsage::shared_blk_read_time, BufferUsage::shared_blk_write_time, start_time, and track_io_timing.
Referenced by ExtendBufferedRelLocal(), ExtendBufferedRelShared(), FlushBuffer(), FlushRelationBuffers(), GetLocalVictimBuffer(), IssuePendingWritebacks(), mdsyncfiletag(), register_dirty_segment(), and WaitReadBuffers().
void pgstat_count_slru_flush | ( | int | slru_idx | ) |
Definition at line 89 of file pgstat_slru.c.
References PgStat_SLRUStats::flush, and get_slru_entry().
Referenced by SimpleLruWriteAll().
void pgstat_count_slru_page_exists | ( | int | slru_idx | ) |
Definition at line 71 of file pgstat_slru.c.
References PgStat_SLRUStats::blocks_exists, and get_slru_entry().
Referenced by SimpleLruDoesPhysicalPageExist().
void pgstat_count_slru_page_hit | ( | int | slru_idx | ) |
Definition at line 65 of file pgstat_slru.c.
References PgStat_SLRUStats::blocks_hit, and get_slru_entry().
Referenced by SimpleLruReadPage(), and SimpleLruReadPage_ReadOnly().
void pgstat_count_slru_page_read | ( | int | slru_idx | ) |
Definition at line 77 of file pgstat_slru.c.
References PgStat_SLRUStats::blocks_read, and get_slru_entry().
Referenced by SimpleLruReadPage().
void pgstat_count_slru_page_written | ( | int | slru_idx | ) |
Definition at line 83 of file pgstat_slru.c.
References PgStat_SLRUStats::blocks_written, and get_slru_entry().
Referenced by SlruPhysicalWritePage().
void pgstat_count_slru_page_zeroed | ( | int | slru_idx | ) |
Definition at line 59 of file pgstat_slru.c.
References PgStat_SLRUStats::blocks_zeroed, and get_slru_entry().
Referenced by SimpleLruZeroPage().
void pgstat_count_slru_truncate | ( | int | slru_idx | ) |
Definition at line 95 of file pgstat_slru.c.
References get_slru_entry(), and PgStat_SLRUStats::truncate.
Referenced by SimpleLruTruncate().
void pgstat_count_truncate | ( | Relation | rel | ) |
Definition at line 416 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().
void pgstat_create_function | ( | Oid | proid | ) |
Definition at line 45 of file pgstat_function.c.
References MyDatabaseId, pgstat_create_transactional(), and PGSTAT_KIND_FUNCTION.
Referenced by ProcedureCreate().
void pgstat_create_relation | ( | Relation | rel | ) |
Definition at line 169 of file pgstat_relation.c.
References InvalidOid, MyDatabaseId, pgstat_create_transactional(), PGSTAT_KIND_RELATION, RelationData::rd_rel, and RelationGetRelid.
Referenced by heap_create().
void pgstat_create_replslot | ( | struct ReplicationSlot * | slot | ) |
Definition at line 111 of file pgstat_replslot.c.
References Assert, InvalidOid, LW_EXCLUSIVE, LWLockHeldByMeInMode(), pgstat_get_entry_ref_locked(), PGSTAT_KIND_REPLSLOT, pgstat_unlock_entry(), ReplicationSlotIndex(), PgStat_EntryRef::shared_stats, and PgStatShared_ReplSlot::stats.
Referenced by ReplicationSlotCreate().
void pgstat_create_subscription | ( | Oid | subid | ) |
Definition at line 61 of file pgstat_subscription.c.
References InvalidOid, pgstat_create_transactional(), pgstat_get_entry_ref(), PGSTAT_KIND_SUBSCRIPTION, and pgstat_reset_entry().
Referenced by CreateSubscription().
void pgstat_discard_stats | ( | void | ) |
Definition at line 489 of file pgstat.c.
References DEBUG2, elog, ereport, errcode_for_file_access(), errmsg(), errmsg_internal(), LOG, pgstat_reset_after_failure(), and PGSTAT_STAT_PERMANENT_FILENAME.
Referenced by StartupXLOG().
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().
void pgstat_drop_function | ( | Oid | proid | ) |
Definition at line 60 of file pgstat_function.c.
References MyDatabaseId, pgstat_drop_transactional(), and PGSTAT_KIND_FUNCTION.
Referenced by RemoveFunctionById().
void pgstat_drop_relation | ( | Relation | rel | ) |
Definition at line 180 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().
void pgstat_drop_replslot | ( | struct ReplicationSlot * | slot | ) |
Definition at line 156 of file pgstat_replslot.c.
References Assert, InvalidOid, LW_EXCLUSIVE, LWLockHeldByMeInMode(), pgstat_drop_entry(), PGSTAT_KIND_REPLSLOT, pgstat_request_entry_refs_gc(), and ReplicationSlotIndex().
Referenced by ReplicationSlotDropPtr().
void pgstat_drop_subscription | ( | Oid | subid | ) |
Definition at line 79 of file pgstat_subscription.c.
References InvalidOid, pgstat_drop_transactional(), and PGSTAT_KIND_SUBSCRIPTION.
Referenced by DropSubscription().
void pgstat_end_function_usage | ( | PgStat_FunctionCallUsage * | fcu, |
bool | finalize | ||
) |
Definition at line 146 of file pgstat_function.c.
References PgStat_FunctionCallUsage::fs, INSTR_TIME_ADD, INSTR_TIME_SET_CURRENT, INSTR_TIME_SUBTRACT, PgStat_FunctionCounts::numcalls, PgStat_FunctionCallUsage::save_f_total_time, PgStat_FunctionCallUsage::save_total, PgStat_FunctionCounts::self_time, PgStat_FunctionCallUsage::start, 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().
void pgstat_execute_transactional_drops | ( | int | ndrops, |
struct xl_xact_stats_item * | items, | ||
bool | is_redo | ||
) |
Definition at line 314 of file pgstat_xact.c.
References xl_xact_stats_item::dboid, i, items, xl_xact_stats_item::kind, xl_xact_stats_item::objid_hi, xl_xact_stats_item::objid_lo, pgstat_drop_entry(), and pgstat_request_entry_refs_gc().
Referenced by FinishPreparedTransaction(), xact_redo_abort(), and xact_redo_commit().
PgStat_StatReplSlotEntry* pgstat_fetch_replslot | ( | NameData | slotname | ) |
Definition at line 170 of file pgstat_replslot.c.
References get_replslot_index(), idx(), InvalidOid, LW_SHARED, LWLockAcquire(), LWLockRelease(), NameStr, pgstat_fetch_entry(), and PGSTAT_KIND_REPLSLOT.
Referenced by pg_stat_get_replication_slot().
PgStat_SLRUStats* pgstat_fetch_slru | ( | void | ) |
Definition at line 105 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().
PgStat_ArchiverStats* pgstat_fetch_stat_archiver | ( | void | ) |
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().
PgStat_BgWriterStats* pgstat_fetch_stat_bgwriter | ( | void | ) |
Definition at line 71 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().
PgStat_CheckpointerStats* pgstat_fetch_stat_checkpointer | ( | void | ) |
Definition at line 82 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().
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_StatFuncEntry* pgstat_fetch_stat_funcentry | ( | Oid | func_id | ) |
Definition at line 239 of file pgstat_function.c.
References MyDatabaseId, pgstat_fetch_entry(), and PGSTAT_KIND_FUNCTION.
Referenced by pg_stat_get_function_calls().
PgStat_IO* pgstat_fetch_stat_io | ( | void | ) |
Definition at line 157 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().
PgStat_StatSubEntry* pgstat_fetch_stat_subscription | ( | Oid | subid | ) |
Definition at line 90 of file pgstat_subscription.c.
References InvalidOid, pgstat_fetch_entry(), and PGSTAT_KIND_SUBSCRIPTION.
Referenced by pg_stat_get_subscription_stats().
PgStat_StatTabEntry* pgstat_fetch_stat_tabentry | ( | Oid | relid | ) |
Definition at line 456 of file pgstat_relation.c.
References IsSharedRelation(), and pgstat_fetch_stat_tabentry_ext().
PgStat_StatTabEntry* pgstat_fetch_stat_tabentry_ext | ( | bool | shared, |
Oid | reloid | ||
) |
Definition at line 466 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().
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_force_next_flush | ( | void | ) |
Definition at line 808 of file pgstat.c.
References pgStatForceNextFlush.
Referenced by pg_stat_force_next_flush().
const char* pgstat_get_io_context_name | ( | IOContext | io_context | ) |
Definition at line 239 of file pgstat_io.c.
References elog, ERROR, IOCONTEXT_BULKREAD, IOCONTEXT_BULKWRITE, IOCONTEXT_NORMAL, IOCONTEXT_VACUUM, and pg_unreachable.
Referenced by pg_stat_get_io().
const char* pgstat_get_io_object_name | ( | IOObject | io_object | ) |
Definition at line 258 of file pgstat_io.c.
References elog, ERROR, IOOBJECT_RELATION, IOOBJECT_TEMP_RELATION, and pg_unreachable.
Referenced by pg_stat_get_io().
PgStat_Kind pgstat_get_kind_from_str | ( | char * | kind_str | ) |
Definition at line 1396 of file pgstat.c.
References ereport, errcode(), errmsg(), ERROR, 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().
int pgstat_get_slru_index | ( | const char * | name | ) |
Definition at line 132 of file pgstat_slru.c.
References i, name, slru_names, and SLRU_NUM_ELEMENTS.
Referenced by pgstat_reset_slru(), and SimpleLruInit().
const char* pgstat_get_slru_name | ( | int | slru_idx | ) |
Definition at line 118 of file pgstat_slru.c.
References slru_names, and SLRU_NUM_ELEMENTS.
Referenced by pg_stat_get_slru().
TimestampTz pgstat_get_stat_snapshot_timestamp | ( | bool * | have_snapshot | ) |
Definition at line 1021 of file pgstat.c.
References 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().
int pgstat_get_transactional_drops | ( | bool | isCommit, |
struct xl_xact_stats_item ** | items | ||
) |
Definition at line 272 of file pgstat_xact.c.
References Assert, dlist_iter::cur, dclist_container, dclist_count(), dclist_foreach, 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().
bool pgstat_have_entry | ( | PgStat_Kind | kind, |
Oid | dboid, | ||
uint64 | objid | ||
) |
Definition at line 1038 of file pgstat.c.
References pgstat_get_entry_ref(), and pgstat_get_kind_info().
Referenced by pg_stat_have_stats().
void pgstat_init_function_usage | ( | struct FunctionCallInfoBaseData * | fcinfo, |
PgStat_FunctionCallUsage * | fcu | ||
) |
void pgstat_init_relation | ( | Relation | rel | ) |
Definition at line 92 of file pgstat_relation.c.
References RelationData::pgstat_enabled, RelationData::pgstat_info, pgstat_track_counts, pgstat_unlink_relation(), and RelationData::rd_rel.
Referenced by relation_open(), and try_relation_open().
void pgstat_initialize | ( | void | ) |
Definition at line 607 of file pgstat.c.
References Assert, before_shmem_exit(), PgStat_KindInfo::init_backend_cb, 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().
|
inlinestatic |
Definition at line 80 of file pgstat.h.
References PGSTAT_KIND_BUILTIN_MAX, and PGSTAT_KIND_BUILTIN_MIN.
Referenced by pgstat_build_snapshot_fixed(), pgstat_get_kind_info(), pgstat_is_kind_valid(), pgstat_read_statsfile(), pgstat_snapshot_fixed(), pgstat_write_statsfile(), and StatsShmemInit().
|
inlinestatic |
Definition at line 86 of file pgstat.h.
References PGSTAT_KIND_CUSTOM_MAX, and PGSTAT_KIND_CUSTOM_MIN.
Referenced by pgstat_get_custom_shmem_data(), pgstat_get_custom_snapshot_data(), pgstat_get_kind_info(), pgstat_is_kind_valid(), pgstat_register_kind(), and pgstat_snapshot_fixed().
instr_time pgstat_prepare_io_time | ( | bool | track_io_guc | ) |
Definition at line 100 of file pgstat_io.c.
References INSTR_TIME_SET_CURRENT, and INSTR_TIME_SET_ZERO.
Referenced by ExtendBufferedRelLocal(), ExtendBufferedRelShared(), FlushBuffer(), FlushRelationBuffers(), GetLocalVictimBuffer(), IssuePendingWritebacks(), mdsyncfiletag(), register_dirty_segment(), and WaitReadBuffers().
void pgstat_report_analyze | ( | Relation | rel, |
PgStat_Counter | livetuples, | ||
PgStat_Counter | deadtuples, | ||
bool | resetcounter | ||
) |
Definition at line 277 of file pgstat_relation.c.
References AmAutoVacuumWorkerProcess, PgStat_StatTabEntry::analyze_count, Assert, PgStat_StatTabEntry::autoanalyze_count, PgStat_TableStatus::counts, PgStat_StatTabEntry::dead_tuples, PgStat_TableCounts::delta_dead_tuples, GetCurrentTimestamp(), if(), InvalidOid, PgStat_StatTabEntry::last_analyze_time, PgStat_StatTabEntry::last_autoanalyze_time, PgStat_StatTabEntry::live_tuples, Max, PgStat_StatTabEntry::mod_since_analyze, MyDatabaseId, 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, PgStatShared_Relation::stats, PgStat_TableStatus::trans, and trans.
Referenced by do_analyze_rel().
void pgstat_report_archiver | ( | const char * | xlog, |
bool | failed | ||
) |
Definition at line 28 of file pgstat_archiver.c.
References PgStat_ArchiverStats::archived_count, PgStat_ShmemControl::archiver, PgStatShared_Archiver::changecount, PgStat_ArchiverStats::failed_count, GetCurrentTimestamp(), PgStat_ArchiverStats::last_archived_timestamp, PgStat_ArchiverStats::last_archived_wal, PgStat_ArchiverStats::last_failed_timestamp, PgStat_ArchiverStats::last_failed_wal, now(), pgstat_begin_changecount_write(), pgstat_end_changecount_write(), pgStatLocal, PgStat_LocalState::shmem, and PgStatShared_Archiver::stats.
Referenced by pgarch_ArchiverCopyLoop().
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_bgwriter | ( | void | ) |
Definition at line 30 of file pgstat_bgwriter.c.
References Assert, PgStat_ShmemControl::bgwriter, BGWRITER_ACC, PgStatShared_BgWriter::changecount, PgStat_ShmemControl::is_shutdown, MemSet, PendingBgWriterStats, pgstat_assert_is_up, pgstat_begin_changecount_write(), pgstat_end_changecount_write(), pgstat_flush_io(), pgStatLocal, and PgStat_LocalState::shmem.
Referenced by BackgroundWriterMain().
void pgstat_report_checkpointer | ( | void | ) |
Definition at line 30 of file pgstat_checkpointer.c.
References Assert, PgStatShared_Checkpointer::changecount, PgStat_ShmemControl::checkpointer, CHECKPOINTER_ACC, PgStat_ShmemControl::is_shutdown, MemSet, PendingCheckpointerStats, pgstat_assert_is_up, pgstat_begin_changecount_write(), pgstat_end_changecount_write(), pgstat_flush_io(), pgStatLocal, and PgStat_LocalState::shmem.
Referenced by CheckpointerMain(), CheckpointWriteDelay(), and HandleCheckpointerInterrupts().
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_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_replslot | ( | struct ReplicationSlot * | slot, |
const PgStat_StatReplSlotEntry * | repSlotStat | ||
) |
Definition at line 78 of file pgstat_replslot.c.
References InvalidOid, pgstat_get_entry_ref_locked(), PGSTAT_KIND_REPLSLOT, pgstat_unlock_entry(), ReplicationSlotIndex(), REPLSLOT_ACC, PgStat_EntryRef::shared_stats, and PgStatShared_ReplSlot::stats.
Referenced by UpdateDecodingStats().
long pgstat_report_stat | ( | bool | force | ) |
Definition at line 660 of file pgstat.c.
References Assert, dlist_is_empty(), PgStat_KindInfo::fixed_amount, PgStat_KindInfo::flush_fixed_cb, GetCurrentTimestamp(), GetCurrentTransactionStopTimestamp(), PgStat_KindInfo::have_fixed_pending_cb, 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_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(), LogicalRepApplyLoop(), LogicalRepSyncTableStart(), pg_attribute_noreturn(), pgstat_before_server_shutdown(), pgstat_shutdown_hook(), PostgresMain(), process_syncing_tables_for_apply(), process_syncing_tables_for_sync(), ProcessInterrupts(), standby_redo(), and worker_spi_main().
void pgstat_report_subscription_conflict | ( | Oid | subid, |
ConflictType | type | ||
) |
Definition at line 46 of file pgstat_subscription.c.
References PgStat_BackendSubEntry::conflict_count, InvalidOid, PgStat_EntryRef::pending, PGSTAT_KIND_SUBSCRIPTION, pgstat_prep_pending_entry(), and type.
Referenced by ReportApplyConflict().
Definition at line 27 of file pgstat_subscription.c.
References PgStat_BackendSubEntry::apply_error_count, InvalidOid, PgStat_EntryRef::pending, PGSTAT_KIND_SUBSCRIPTION, pgstat_prep_pending_entry(), and PgStat_BackendSubEntry::sync_error_count.
Referenced by DisableSubscriptionAndExit(), start_apply(), and start_table_sync().
void pgstat_report_vacuum | ( | Oid | tableoid, |
bool | shared, | ||
PgStat_Counter | livetuples, | ||
PgStat_Counter | deadtuples | ||
) |
Definition at line 211 of file pgstat_relation.c.
References AmAutoVacuumWorkerProcess, PgStat_StatTabEntry::autovacuum_count, PgStat_StatTabEntry::dead_tuples, GetCurrentTimestamp(), if(), PgStat_StatTabEntry::ins_since_vacuum, InvalidOid, PgStat_StatTabEntry::last_autovacuum_time, PgStat_StatTabEntry::last_vacuum_time, PgStat_StatTabEntry::live_tuples, MyDatabaseId, pgstat_flush_io(), pgstat_get_entry_ref_locked(), PGSTAT_KIND_RELATION, pgstat_track_counts, pgstat_unlock_entry(), PgStat_EntryRef::shared_stats, PgStatShared_Relation::stats, and PgStat_StatTabEntry::vacuum_count.
Referenced by heap_vacuum_rel().
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().
void pgstat_reset | ( | PgStat_Kind | kind, |
Oid | dboid, | ||
uint64 | objid | ||
) |
Definition at line 848 of file pgstat.c.
References PgStat_KindInfo::accessed_across_databases, Assert, GetCurrentTimestamp(), pgstat_get_kind_info(), pgstat_reset_database_timestamp(), and pgstat_reset_entry().
Referenced by pg_stat_reset_single_function_counters(), pg_stat_reset_single_table_counters(), pg_stat_reset_subscription_stats(), pgstat_create_transactional(), and pgstat_reset_replslot().
void pgstat_reset_counters | ( | void | ) |
Definition at line 829 of file pgstat.c.
References GetCurrentTimestamp(), match_db_entries(), MyDatabaseId, ObjectIdGetDatum(), and pgstat_reset_matching_entries().
Referenced by pg_stat_reset().
void pgstat_reset_of_kind | ( | PgStat_Kind | kind | ) |
Definition at line 870 of file pgstat.c.
References PgStat_KindInfo::fixed_amount, GetCurrentTimestamp(), pgstat_get_kind_info(), pgstat_reset_entries_of_kind(), and PgStat_KindInfo::reset_all_cb.
Referenced by pg_stat_reset_replication_slot(), pg_stat_reset_shared(), pg_stat_reset_slru(), and pg_stat_reset_subscription_stats().
void pgstat_reset_replslot | ( | const char * | name | ) |
Definition at line 42 of file pgstat_replslot.c.
References Assert, ereport, errcode(), errmsg(), ERROR, InvalidOid, LW_SHARED, LWLockAcquire(), LWLockRelease(), name, PGSTAT_KIND_REPLSLOT, pgstat_reset(), ReplicationSlotIndex(), SearchNamedReplicationSlot(), and SlotIsLogical.
Referenced by pg_stat_reset_replication_slot().
void pgstat_reset_slru | ( | const char * | name | ) |
Definition at line 45 of file pgstat_slru.c.
References Assert, GetCurrentTimestamp(), name, pgstat_get_slru_index(), and pgstat_reset_slru_counter_internal().
Referenced by pg_stat_reset_slru().
void pgstat_restore_stats | ( | XLogRecPtr | redo | ) |
Definition at line 477 of file pgstat.c.
References pgstat_read_statsfile().
Referenced by StartupXLOG().
bool pgstat_tracks_io_bktype | ( | BackendType | bktype | ) |
Definition at line 346 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_INVALID, B_LOGGER, B_SLOTSYNC_WORKER, B_STANDALONE_BACKEND, B_STARTUP, B_WAL_RECEIVER, B_WAL_SENDER, B_WAL_SUMMARIZER, and B_WAL_WRITER.
Referenced by pg_stat_get_io(), and pgstat_tracks_io_object().
bool pgstat_tracks_io_object | ( | BackendType | bktype, |
IOObject | io_object, | ||
IOContext | io_context | ||
) |
Definition at line 386 of file pgstat_io.c.
References B_AUTOVAC_LAUNCHER, B_AUTOVAC_WORKER, B_BG_WRITER, B_CHECKPOINTER, B_STANDALONE_BACKEND, B_STARTUP, IOCONTEXT_BULKREAD, IOCONTEXT_BULKWRITE, IOCONTEXT_NORMAL, IOCONTEXT_VACUUM, IOOBJECT_TEMP_RELATION, and pgstat_tracks_io_bktype().
Referenced by pg_stat_get_io(), and pgstat_tracks_io_op().
bool pgstat_tracks_io_op | ( | BackendType | bktype, |
IOObject | io_object, | ||
IOContext | io_context, | ||
IOOp | io_op | ||
) |
Definition at line 451 of file pgstat_io.c.
References B_AUTOVAC_LAUNCHER, B_BG_WRITER, B_CHECKPOINTER, IOCONTEXT_BULKREAD, IOCONTEXT_BULKWRITE, IOCONTEXT_VACUUM, IOOBJECT_TEMP_RELATION, IOOP_EVICT, IOOP_EXTEND, IOOP_FSYNC, IOOP_HIT, IOOP_READ, IOOP_REUSE, IOOP_WRITEBACK, and pgstat_tracks_io_object().
Referenced by pg_stat_get_io(), pgstat_bktype_io_stats_valid(), and pgstat_count_io_op_n().
void pgstat_twophase_postabort | ( | TransactionId | xid, |
uint16 | info, | ||
void * | recdata, | ||
uint32 | len | ||
) |
Definition at line 769 of file pgstat_relation.c.
References PgStat_TableStatus::counts, TwoPhasePgStatRecord::deleted_pre_truncdrop, PgStat_TableCounts::delta_dead_tuples, 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.
void pgstat_twophase_postcommit | ( | TransactionId | xid, |
uint16 | info, | ||
void * | recdata, | ||
uint32 | len | ||
) |
Definition at line 733 of file pgstat_relation.c.
References PgStat_TableCounts::changed_tuples, PgStat_TableStatus::counts, PgStat_TableCounts::delta_dead_tuples, PgStat_TableCounts::delta_live_tuples, 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.
void pgstat_unlink_relation | ( | Relation | rel | ) |
Definition at line 153 of file pgstat_relation.c.
References Assert, RelationData::pgstat_info, and PgStat_TableStatus::relation.
Referenced by pgstat_init_relation(), pgstat_relation_delete_pending_cb(), and RelationDestroyRelation().
void pgstat_update_heap_dead_tuples | ( | Relation | rel, |
int | delta | ||
) |
Definition at line 439 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().
void PostPrepare_PgStat | ( | void | ) |
Definition at line 211 of file pgstat_xact.c.
References Assert, PgStat_SubXactStatus::nest_level, pgstat_clear_snapshot(), pgStatXactStack, PostPrepare_PgStat_Relations(), and PgStat_SubXactStatus::prev.
Referenced by PrepareTransaction().
void StatsShmemInit | ( | void | ) |
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(), PgStat_KindInfo::fixed_amount, idx(), PgStat_KindInfo::init_shmem_cb, IsUnderPostmaster, LWTRANCHE_PGSTATS_DSA, 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_KindInfo::shared_ctl_off, PgStat_KindInfo::shared_size, PgStat_LocalState::shmem, ShmemAlloc(), ShmemInitStruct(), and StatsShmemSize().
Referenced by CreateOrAttachShmemStructs().
Size StatsShmemSize | ( | void | ) |
Definition at line 127 of file pgstat_shmem.c.
References add_size(), Assert, PgStat_KindInfo::fixed_amount, MAXALIGN, pgstat_dsa_init_size(), pgstat_get_kind_info(), PgStat_Kind, PGSTAT_KIND_CUSTOM_MAX, PGSTAT_KIND_CUSTOM_MIN, and PgStat_KindInfo::shared_size.
Referenced by CalculateShmemSize(), and StatsShmemInit().
|
extern |
Definition at line 23 of file pgstat_bgwriter.c.
Referenced by BgBufferSync(), and pgstat_report_bgwriter().
|
extern |
Definition at line 23 of file pgstat_checkpointer.c.
Referenced by BufferSync(), CheckpointerMain(), HandleCheckpointerInterrupts(), LogCheckpointEnd(), pgstat_report_checkpointer(), and SlruInternalWritePage().
|
extern |
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().
|
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().