PostgreSQL Source Code git master
|
#include "postgres.h"
#include <unistd.h>
#include "access/xact.h"
#include "access/xlog.h"
#include "lib/dshash.h"
#include "pgstat.h"
#include "storage/fd.h"
#include "storage/ipc.h"
#include "storage/lwlock.h"
#include "utils/guc_hooks.h"
#include "utils/memutils.h"
#include "utils/pgstat_internal.h"
#include "utils/timestamp.h"
#include "lib/simplehash.h"
Go to the source code of this file.
Data Structures | |
struct | PgStat_SnapshotEntry |
Macros | |
#define | PGSTAT_MIN_INTERVAL 1000 |
#define | PGSTAT_MAX_INTERVAL 60000 |
#define | PGSTAT_IDLE_INTERVAL 10000 |
#define | PGSTAT_SNAPSHOT_HASH_SIZE 512 |
#define | PGSTAT_FILE_ENTRY_END 'E' /* end of file */ |
#define | PGSTAT_FILE_ENTRY_FIXED 'F' /* fixed-numbered stats entry */ |
#define | PGSTAT_FILE_ENTRY_NAME 'N' /* stats entry identified by name */ |
#define | PGSTAT_FILE_ENTRY_HASH |
#define | SH_PREFIX pgstat_snapshot |
#define | SH_ELEMENT_TYPE PgStat_SnapshotEntry |
#define | SH_KEY_TYPE PgStat_HashKey |
#define | SH_KEY key |
#define | SH_HASH_KEY(tb, key) pgstat_hash_hash_key(&key, sizeof(PgStat_HashKey), NULL) |
#define | SH_EQUAL(tb, a, b) pgstat_cmp_hash_key(&a, &b, sizeof(PgStat_HashKey), NULL) == 0 |
#define | SH_SCOPE static inline |
#define | SH_DEFINE |
#define | SH_DECLARE |
#define | write_chunk_s(fpout, ptr) write_chunk(fpout, ptr, sizeof(*ptr)) |
#define | read_chunk_s(fpin, ptr) read_chunk(fpin, ptr, sizeof(*ptr)) |
Typedefs | |
typedef struct PgStat_SnapshotEntry | PgStat_SnapshotEntry |
Variables | |
bool | pgstat_track_counts = false |
int | pgstat_fetch_consistency = PGSTAT_FETCH_CONSISTENCY_CACHE |
PgStat_LocalState | pgStatLocal |
static MemoryContext | pgStatPendingContext = NULL |
static dlist_head | pgStatPending = DLIST_STATIC_INIT(pgStatPending) |
static bool | pgStatForceNextFlush = false |
static bool | force_stats_snapshot_clear = false |
static const PgStat_KindInfo | pgstat_kind_builtin_infos [PGSTAT_KIND_BUILTIN_SIZE] |
static const PgStat_KindInfo ** | pgstat_kind_custom_infos = NULL |
#define PGSTAT_FILE_ENTRY_FIXED 'F' /* fixed-numbered stats entry */ |
#define PGSTAT_FILE_ENTRY_HASH |
#define PGSTAT_FILE_ENTRY_NAME 'N' /* stats entry identified by name */ |
#define read_chunk_s | ( | fpin, | |
ptr | |||
) | read_chunk(fpin, ptr, sizeof(*ptr)) |
#define SH_ELEMENT_TYPE PgStat_SnapshotEntry |
#define SH_EQUAL | ( | tb, | |
a, | |||
b | |||
) | pgstat_cmp_hash_key(&a, &b, sizeof(PgStat_HashKey), NULL) == 0 |
#define SH_HASH_KEY | ( | tb, | |
key | |||
) | pgstat_hash_hash_key(&key, sizeof(PgStat_HashKey), NULL) |
#define SH_KEY_TYPE PgStat_HashKey |
#define write_chunk_s | ( | fpout, | |
ptr | |||
) | write_chunk(fpout, ptr, sizeof(*ptr)) |
typedef struct PgStat_SnapshotEntry PgStat_SnapshotEntry |
void assign_stats_fetch_consistency | ( | int | newval, |
void * | extra | ||
) |
Definition at line 2087 of file pgstat.c.
References force_stats_snapshot_clear, newval, and pgstat_fetch_consistency.
|
static |
Definition at line 839 of file pgstat.c.
References DatumGetObjectId(), PgStat_HashKey::dboid, PgStatShared_HashEntry::key, and MyDatabaseId.
Referenced by pgstat_reset_counters().
void pgstat_before_server_shutdown | ( | int | code, |
Datum | arg | ||
) |
Definition at line 560 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().
|
static |
Definition at line 1139 of file pgstat.c.
References PgStat_KindInfo::accessed_across_databases, Assert, PgStatShared_HashEntry::body, PgStat_Snapshot::context, PgStat_SnapshotEntry::data, PgStat_HashKey::dboid, PgStatShared_HashEntry::dropped, PgStat_LocalState::dsa, dsa_get_address(), dshash_seq_init(), dshash_seq_next(), dshash_seq_term(), PgStat_KindInfo::fixed_amount, GetCurrentTimestamp(), InvalidOid, PgStatShared_HashEntry::key, PgStat_HashKey::kind, PgStatShared_Common::lock, LW_SHARED, LWLockAcquire(), LWLockRelease(), MemoryContextAlloc(), PgStat_Snapshot::mode, MyDatabaseId, pg_atomic_read_u32(), pgstat_build_snapshot_fixed(), pgstat_fetch_consistency, PGSTAT_FETCH_CONSISTENCY_SNAPSHOT, pgstat_get_entry_data(), pgstat_get_kind_info(), PgStat_Kind, PGSTAT_KIND_MAX, PGSTAT_KIND_MIN, pgstat_prep_snapshot(), pgStatLocal, PgStatShared_HashEntry::refcount, PgStat_LocalState::shared_hash, PgStat_KindInfo::shared_size, PgStat_LocalState::snapshot, PgStat_KindInfo::snapshot_cb, PgStat_Snapshot::snapshot_timestamp, and PgStat_Snapshot::stats.
Referenced by pgstat_fetch_entry(), and pgstat_snapshot_fixed().
|
static |
Definition at line 1229 of file pgstat.c.
References Assert, PgStat_Snapshot::custom_valid, PgStat_KindInfo::fixed_amount, PgStat_Snapshot::fixed_valid, idx(), pgstat_fetch_consistency, PGSTAT_FETCH_CONSISTENCY_CACHE, PGSTAT_FETCH_CONSISTENCY_NONE, pgstat_get_kind_info(), pgstat_is_kind_builtin(), PGSTAT_KIND_CUSTOM_MIN, pgStatLocal, PgStat_LocalState::snapshot, and PgStat_KindInfo::snapshot_cb.
Referenced by pgstat_build_snapshot(), pgstat_snapshot_fixed(), and pgstat_write_statsfile().
void pgstat_clear_snapshot | ( | void | ) |
Definition at line 918 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().
void pgstat_delete_pending_entry | ( | PgStat_EntryRef * | entry_ref | ) |
Definition at line 1335 of file pgstat.c.
References Assert, PgStat_KindInfo::delete_pending_cb, dlist_delete(), PgStatShared_HashEntry::key, PgStat_HashKey::kind, PgStat_EntryRef::pending, PgStat_EntryRef::pending_node, pfree(), pgstat_get_kind_info(), PgStat_Kind, and PgStat_EntryRef::shared_entry.
Referenced by pgstat_flush_pending_entries(), and pgstat_release_entry_ref().
void pgstat_discard_stats | ( | void | ) |
Definition at line 517 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_fetch_entry | ( | PgStat_Kind | kind, |
Oid | dboid, | ||
uint64 | objid | ||
) |
Definition at line 950 of file pgstat.c.
References Assert, PgStat_Snapshot::context, PgStat_SnapshotEntry::data, PgStatShared_HashEntry::dropped, PgStat_KindInfo::fixed_amount, IsPostmasterEnvironment, IsUnderPostmaster, sort-test::key, MemoryContextAlloc(), PgStat_Snapshot::mode, palloc(), pgstat_build_snapshot(), pgstat_fetch_consistency, PGSTAT_FETCH_CONSISTENCY_CACHE, PGSTAT_FETCH_CONSISTENCY_NONE, PGSTAT_FETCH_CONSISTENCY_SNAPSHOT, pgstat_get_entry_data(), pgstat_get_entry_ref(), pgstat_get_kind_info(), pgstat_lock_entry_shared(), pgstat_prep_snapshot(), pgstat_unlock_entry(), pgStatLocal, PgStat_KindInfo::shared_data_len, PgStat_EntryRef::shared_entry, PgStat_EntryRef::shared_stats, PgStat_LocalState::snapshot, and PgStat_Snapshot::stats.
Referenced by pgstat_fetch_replslot(), pgstat_fetch_stat_backend(), pgstat_fetch_stat_dbentry(), pgstat_fetch_stat_funcentry(), pgstat_fetch_stat_injentry(), pgstat_fetch_stat_subscription(), and pgstat_fetch_stat_tabentry_ext().
PgStat_EntryRef * pgstat_fetch_pending_entry | ( | PgStat_Kind | kind, |
Oid | dboid, | ||
uint64 | objid | ||
) |
Definition at line 1322 of file pgstat.c.
References PgStat_EntryRef::pending, and pgstat_get_entry_ref().
Referenced by find_funcstat_entry(), and find_tabstat_entry().
|
static |
Definition at line 1358 of file pgstat.c.
References Assert, cur, dlist_container, dlist_has_next(), dlist_head_node(), dlist_is_empty(), dlist_next_node(), PgStat_KindInfo::fixed_amount, PgStat_KindInfo::flush_pending_cb, PgStatShared_HashEntry::key, sort-test::key, next, pgstat_delete_pending_entry(), pgstat_get_kind_info(), PgStat_Kind, pgStatPending, and PgStat_EntryRef::shared_entry.
Referenced by pgstat_report_stat().
void pgstat_force_next_flush | ( | void | ) |
Definition at line 830 of file pgstat.c.
References pgStatForceNextFlush.
Referenced by pg_stat_force_next_flush().
PgStat_Kind pgstat_get_kind_from_str | ( | char * | kind_str | ) |
Definition at line 1420 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().
const PgStat_KindInfo * pgstat_get_kind_info | ( | PgStat_Kind | kind | ) |
Definition at line 1454 of file pgstat.c.
References idx(), pgstat_is_kind_builtin(), pgstat_is_kind_custom(), pgstat_kind_builtin_infos, pgstat_kind_custom_infos, and PGSTAT_KIND_CUSTOM_MIN.
Referenced by pgstat_build_snapshot(), pgstat_build_snapshot_fixed(), pgstat_create_transactional(), pgstat_delete_pending_entry(), pgstat_drop_entry_internal(), pgstat_fetch_entry(), pgstat_flush_pending_entries(), pgstat_get_custom_shmem_data(), pgstat_get_custom_snapshot_data(), pgstat_get_entry_data(), pgstat_get_entry_len(), pgstat_have_entry(), pgstat_init_entry(), pgstat_init_snapshot_fixed(), pgstat_initialize(), pgstat_prep_pending_entry(), pgstat_read_statsfile(), pgstat_report_stat(), pgstat_reset(), pgstat_reset_after_failure(), pgstat_reset_entry(), pgstat_reset_of_kind(), pgstat_snapshot_fixed(), pgstat_write_statsfile(), shared_stat_reset_contents(), StatsShmemInit(), and StatsShmemSize().
TimestampTz pgstat_get_stat_snapshot_timestamp | ( | bool * | have_snapshot | ) |
Definition at line 1046 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().
bool pgstat_have_entry | ( | PgStat_Kind | kind, |
Oid | dboid, | ||
uint64 | objid | ||
) |
Definition at line 1063 of file pgstat.c.
References pgstat_get_entry_ref(), and pgstat_get_kind_info().
Referenced by pg_stat_have_stats().
|
static |
Definition at line 1099 of file pgstat.c.
References PgStat_Snapshot::custom_data, PgStat_KindInfo::fixed_amount, MemoryContextAlloc(), pgstat_get_kind_info(), PgStat_Kind, PGSTAT_KIND_CUSTOM_MAX, PGSTAT_KIND_CUSTOM_MIN, pgStatLocal, PgStat_KindInfo::shared_data_len, PgStat_LocalState::snapshot, and TopMemoryContext.
Referenced by pgstat_initialize().
void pgstat_initialize | ( | void | ) |
Definition at line 639 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 1448 of file pgstat.c.
References pgstat_is_kind_builtin(), and pgstat_is_kind_custom().
Referenced by pgstat_read_statsfile(), pgstat_snapshot_fixed(), and pgstat_write_statsfile().
PgStat_EntryRef * pgstat_prep_pending_entry | ( | PgStat_Kind | kind, |
Oid | dboid, | ||
uint64 | objid, | ||
bool * | created_entry | ||
) |
Definition at line 1284 of file pgstat.c.
References ALLOCSET_SMALL_SIZES, AllocSetContextCreate, Assert, dlist_push_tail(), MemoryContextAllocZero(), PgStat_EntryRef::pending, PgStat_EntryRef::pending_node, PgStat_KindInfo::pending_size, pgstat_get_entry_ref(), pgstat_get_kind_info(), pgStatPending, pgStatPendingContext, TopMemoryContext, and unlikely.
Referenced by pgstat_create_inj(), pgstat_init_function_usage(), pgstat_prep_database_pending(), pgstat_prep_relation_pending(), pgstat_report_inj(), pgstat_report_subscription_conflict(), and pgstat_report_subscription_error().
|
static |
Definition at line 1118 of file pgstat.c.
References ALLOCSET_SMALL_SIZES, AllocSetContextCreate, PgStat_Snapshot::context, force_stats_snapshot_clear, pgstat_clear_snapshot(), pgstat_fetch_consistency, PGSTAT_FETCH_CONSISTENCY_NONE, PGSTAT_SNAPSHOT_HASH_SIZE, pgStatLocal, PgStat_LocalState::snapshot, PgStat_Snapshot::stats, and TopMemoryContext.
Referenced by pgstat_build_snapshot(), and pgstat_fetch_entry().
|
static |
Definition at line 1775 of file pgstat.c.
References AllocateFile(), Assert, CHECK_FOR_INTERRUPTS, PgStat_ShmemControl::custom_data, DEBUG2, dshash_find_or_insert(), dshash_release_lock(), elog, ereport, errcode_for_file_access(), errmsg(), error(), PgStat_KindInfo::fixed_amount, FreeFile(), PgStat_KindInfo::from_serialized_name, idx(), IsPostmasterEnvironment, IsUnderPostmaster, sort-test::key, LOG, LSN_FORMAT_ARGS, name, NameStr, PG_BINARY_R, PGSTAT_FILE_ENTRY_END, PGSTAT_FILE_ENTRY_FIXED, PGSTAT_FILE_ENTRY_HASH, PGSTAT_FILE_ENTRY_NAME, PGSTAT_FILE_FORMAT_ID, pgstat_get_entry_data(), pgstat_get_entry_len(), pgstat_get_kind_info(), pgstat_init_entry(), pgstat_is_kind_builtin(), pgstat_is_kind_valid(), PgStat_Kind, PGSTAT_KIND_CUSTOM_MIN, pgstat_reset_after_failure(), PGSTAT_STAT_PERMANENT_FILENAME, pgStatLocal, read_chunk(), read_chunk_s, PgStat_KindInfo::shared_ctl_off, PgStat_KindInfo::shared_data_len, PgStat_KindInfo::shared_data_off, PgStat_LocalState::shared_hash, PgStat_LocalState::shmem, and WARNING.
Referenced by pgstat_restore_stats().
void pgstat_register_kind | ( | PgStat_Kind | kind, |
const PgStat_KindInfo * | kind_info | ||
) |
Definition at line 1482 of file pgstat.c.
References ereport, errdetail(), errhint(), errmsg(), ERROR, PgStat_KindInfo::fixed_amount, idx(), LOG, MemoryContextAllocZero(), name, PgStat_KindInfo::name, pg_strcasecmp(), pgstat_is_kind_custom(), PgStat_Kind, pgstat_kind_custom_infos, PGSTAT_KIND_CUSTOM_MAX, PGSTAT_KIND_CUSTOM_MIN, PGSTAT_KIND_CUSTOM_SIZE, process_shared_preload_libraries_in_progress, PgStat_KindInfo::shared_size, and TopMemoryContext.
Referenced by pgstat_register_inj(), and pgstat_register_inj_fixed().
long pgstat_report_stat | ( | bool | force | ) |
Definition at line 692 of file pgstat.c.
References Assert, dlist_is_empty(), PgStat_KindInfo::flush_static_cb, GetCurrentTimestamp(), GetCurrentTransactionStopTimestamp(), PgStat_KindInfo::have_static_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_reset | ( | PgStat_Kind | kind, |
Oid | dboid, | ||
uint64 | objid | ||
) |
Definition at line 870 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_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().
|
static |
Definition at line 2064 of file pgstat.c.
References PgStat_KindInfo::fixed_amount, GetCurrentTimestamp(), pgstat_drop_all_entries(), pgstat_get_kind_info(), PgStat_Kind, PGSTAT_KIND_MAX, PGSTAT_KIND_MIN, and PgStat_KindInfo::reset_all_cb.
Referenced by pgstat_discard_stats(), and pgstat_read_statsfile().
void pgstat_reset_counters | ( | void | ) |
Definition at line 851 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 892 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_restore_stats | ( | XLogRecPtr | redo | ) |
Definition at line 505 of file pgstat.c.
References pgstat_read_statsfile().
Referenced by StartupXLOG().
|
static |
Definition at line 601 of file pgstat.c.
References Assert, dlist_init(), dlist_is_empty(), InvalidOid, IsPostmasterEnvironment, IsUnderPostmaster, MyDatabaseId, MyProcNumber, OidIsValid, pgstat_detach_shmem(), pgstat_drop_entry(), PGSTAT_KIND_BACKEND, pgstat_report_disconnect(), pgstat_report_stat(), pgstat_request_entry_refs_gc(), and pgStatPending.
Referenced by pgstat_initialize().
void pgstat_snapshot_fixed | ( | PgStat_Kind | kind | ) |
Definition at line 1079 of file pgstat.c.
References Assert, PgStat_Snapshot::custom_valid, PgStat_Snapshot::fixed_valid, force_stats_snapshot_clear, pgstat_build_snapshot(), pgstat_build_snapshot_fixed(), pgstat_clear_snapshot(), pgstat_fetch_consistency, PGSTAT_FETCH_CONSISTENCY_SNAPSHOT, pgstat_get_kind_info(), pgstat_is_kind_builtin(), pgstat_is_kind_custom(), pgstat_is_kind_valid(), PGSTAT_KIND_CUSTOM_MIN, pgStatLocal, and PgStat_LocalState::snapshot.
Referenced by injection_points_stats_fixed(), pgstat_fetch_slru(), pgstat_fetch_stat_archiver(), pgstat_fetch_stat_bgwriter(), pgstat_fetch_stat_checkpointer(), pgstat_fetch_stat_io(), and pgstat_fetch_stat_wal().
|
static |
Definition at line 1587 of file pgstat.c.
References AllocateFile(), Assert, B_CHECKPOINTER, CHECK_FOR_INTERRUPTS, PgStat_Snapshot::custom_data, DEBUG2, PgStat_LocalState::dsa, dsa_get_address(), dshash_seq_init(), dshash_seq_next(), dshash_seq_term(), durable_rename(), elog, ereport, errcode_for_file_access(), errmsg(), PgStat_KindInfo::fixed_amount, FreeFile(), IsUnderPostmaster, LOG, LSN_FORMAT_ARGS, MyBackendType, name, pg_atomic_read_u32(), PG_BINARY_W, pgstat_assert_is_up, pgstat_build_snapshot_fixed(), pgstat_fetch_consistency, PGSTAT_FETCH_CONSISTENCY_NONE, PGSTAT_FILE_ENTRY_END, PGSTAT_FILE_ENTRY_FIXED, PGSTAT_FILE_ENTRY_HASH, PGSTAT_FILE_ENTRY_NAME, PGSTAT_FILE_FORMAT_ID, pgstat_get_entry_data(), pgstat_get_entry_len(), pgstat_get_kind_info(), pgstat_is_kind_builtin(), pgstat_is_kind_valid(), PgStat_Kind, PGSTAT_KIND_CUSTOM_MIN, PGSTAT_KIND_MAX, PGSTAT_KIND_MIN, PGSTAT_STAT_PERMANENT_FILENAME, PGSTAT_STAT_PERMANENT_TMPFILE, pgStatLocal, ps, PgStat_KindInfo::shared_data_len, PgStat_LocalState::shared_hash, PgStat_LocalState::snapshot, PgStat_KindInfo::snapshot_ctl_off, PgStat_KindInfo::to_serialized_name, WARNING, write_chunk(), write_chunk_s, and PgStat_KindInfo::write_to_file.
Referenced by pgstat_before_server_shutdown().
|
static |
Definition at line 1761 of file pgstat.c.
References len.
Referenced by pgstat_read_statsfile().
|
static |
Definition at line 1570 of file pgstat.c.
References len.
Referenced by pgstat_write_statsfile().
|
static |
Definition at line 251 of file pgstat.c.
Referenced by assign_stats_fetch_consistency(), pgstat_clear_snapshot(), pgstat_get_stat_snapshot_timestamp(), pgstat_prep_snapshot(), and pgstat_snapshot_fixed().
int pgstat_fetch_consistency = PGSTAT_FETCH_CONSISTENCY_CACHE |
Definition at line 205 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().
|
static |
Definition at line 277 of file pgstat.c.
Referenced by pgstat_get_kind_from_str(), and pgstat_get_kind_info().
|
static |
Definition at line 492 of file pgstat.c.
Referenced by pgstat_get_kind_from_str(), pgstat_get_kind_info(), and pgstat_register_kind().
bool pgstat_track_counts = false |
Definition at line 204 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().
|
static |
Definition at line 245 of file pgstat.c.
Referenced by pgstat_force_next_flush(), and pgstat_report_stat().
PgStat_LocalState pgStatLocal |
Definition at line 213 of file pgstat.c.
Referenced by pgstat_acquire_entry_ref(), pgstat_archiver_reset_all_cb(), pgstat_archiver_snapshot_cb(), pgstat_attach_shmem(), pgstat_before_server_shutdown(), pgstat_bgwriter_reset_all_cb(), pgstat_bgwriter_snapshot_cb(), pgstat_build_snapshot(), pgstat_build_snapshot_fixed(), pgstat_checkpointer_reset_all_cb(), pgstat_checkpointer_snapshot_cb(), pgstat_clear_snapshot(), pgstat_detach_shmem(), pgstat_drop_database_and_contents(), pgstat_drop_entry(), pgstat_drop_entry_internal(), pgstat_drop_matching_entries(), pgstat_fetch_entry(), pgstat_fetch_slru(), pgstat_fetch_stat_archiver(), pgstat_fetch_stat_bgwriter(), pgstat_fetch_stat_checkpointer(), pgstat_fetch_stat_io(), pgstat_fetch_stat_wal(), pgstat_free_entry(), pgstat_gc_entry_refs(), pgstat_get_custom_shmem_data(), pgstat_get_custom_snapshot_data(), pgstat_get_entry_ref(), pgstat_get_stat_snapshot_timestamp(), pgstat_init_entry(), pgstat_init_snapshot_fixed(), pgstat_io_flush_cb(), pgstat_io_reset_all_cb(), pgstat_io_snapshot_cb(), pgstat_need_entry_refs_gc(), pgstat_prep_snapshot(), pgstat_read_statsfile(), pgstat_reinit_entry(), pgstat_release_entry_ref(), pgstat_report_archiver(), pgstat_report_bgwriter(), pgstat_report_checkpointer(), pgstat_report_stat(), pgstat_request_entry_refs_gc(), pgstat_reset_matching_entries(), pgstat_reset_slru_counter_internal(), pgstat_setup_shared_refs(), pgstat_slru_flush_cb(), pgstat_slru_snapshot_cb(), pgstat_snapshot_fixed(), pgstat_wal_flush_cb(), pgstat_wal_reset_all_cb(), pgstat_wal_snapshot_cb(), pgstat_write_statsfile(), and StatsShmemInit().
|
static |
Definition at line 238 of file pgstat.c.
Referenced by pgstat_flush_pending_entries(), pgstat_prep_pending_entry(), pgstat_report_stat(), and pgstat_shutdown_hook().
|
static |
Definition at line 230 of file pgstat.c.
Referenced by pgstat_prep_pending_entry().