diff options
author | Andres Freund <andres@anarazel.de> | 2022-04-06 17:56:19 -0700 |
---|---|---|
committer | Andres Freund <andres@anarazel.de> | 2022-04-06 17:56:19 -0700 |
commit | 997afad89d12f314555600feee8189d753e105d1 (patch) | |
tree | 7fe8960a796997bf3e91f134c348e292ab9385c0 /src | |
parent | 0d5c387573be5c40bf18b7b8983f406637dff42f (diff) | |
download | postgresql-997afad89d12f314555600feee8189d753e105d1.tar.gz postgresql-997afad89d12f314555600feee8189d753e105d1.zip |
pgstat: introduce PgStat_Kind enum.
Will be used by following commits to generalize stats infrastructure. Kept
separate to allow commits stand reasonably on their own.
Reviewed-By: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Discussion: https://postgr.es/m/20220404041516.cctrvpadhuriawlq@alap3.anarazel.de
Diffstat (limited to 'src')
-rw-r--r-- | src/include/pgstat.h | 24 | ||||
-rw-r--r-- | src/tools/pgindent/typedefs.list | 1 |
2 files changed, 25 insertions, 0 deletions
diff --git a/src/include/pgstat.h b/src/include/pgstat.h index ed141f2d2fd..1bd1c5cf7b0 100644 --- a/src/include/pgstat.h +++ b/src/include/pgstat.h @@ -33,6 +33,30 @@ /* Default directory to store temporary statistics data in */ #define PG_STAT_TMP_DIR "pg_stat_tmp" +/* The types of statistics entries */ +typedef enum PgStat_Kind +{ + /* use 0 for INVALID, to catch zero-initialized data */ + PGSTAT_KIND_INVALID = 0, + + /* stats for variable-numbered objects */ + PGSTAT_KIND_DATABASE, /* database-wide statistics */ + PGSTAT_KIND_RELATION, /* per-table statistics */ + PGSTAT_KIND_FUNCTION, /* per-function statistics */ + PGSTAT_KIND_REPLSLOT, /* per-slot statistics */ + PGSTAT_KIND_SUBSCRIPTION, /* per-subscription statistics */ + + /* stats for fixed-numbered objects */ + PGSTAT_KIND_ARCHIVER, + PGSTAT_KIND_BGWRITER, + PGSTAT_KIND_CHECKPOINTER, + PGSTAT_KIND_SLRU, + PGSTAT_KIND_WAL, +} PgStat_Kind; + +#define PGSTAT_KIND_FIRST_VALID PGSTAT_KIND_DATABASE +#define PGSTAT_KIND_LAST PGSTAT_KIND_WAL +#define PGSTAT_NUM_KINDS (PGSTAT_KIND_LAST + 1) /* Values for track_functions GUC variable --- order is significant! */ typedef enum TrackFunctionsLevel diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list index 9b4f77fbf18..e1684d4caec 100644 --- a/src/tools/pgindent/typedefs.list +++ b/src/tools/pgindent/typedefs.list @@ -1942,6 +1942,7 @@ PgStat_FunctionCallUsage PgStat_FunctionCounts PgStat_FunctionEntry PgStat_GlobalStats +PgStat_Kind PgStat_Msg PgStat_MsgAnalyze PgStat_MsgAnlAncestors |