LCOV - differential code coverage report
Current view: top level - src/include/utils - pgstat_kind.h (source / functions) Coverage Total Hit UBC CBC
Current: f76c13edadc2b319036e0d238703ed56bb23f934 vs 9e17d25e79d4756be08b4a5521b4b58450217137 Lines: 100.0 % 4 4 4
Current Date: 2026-09-20 14:13:17 +0900 Functions: 100.0 % 2 2 2
Baseline: lcov-20260920-baseline Branches: 75.0 % 8 6 2 6
Baseline Date: 2026-09-20 14:13:13 +0900 Line coverage date bins:
Legend: Lines:     hit not hit
Branches: + taken - not taken # not executed
(360..) days: 100.0 % 4 4 4
Function coverage date bins:
(360..) days: 100.0 % 2 2 2
Branch coverage date bins:
(360..) days: 75.0 % 8 6 2 6

 Age         Owner                    Branch data    TLA  Line data    Source code
                                  1                 :                : /* ----------
                                  2                 :                :  *  pgstat_kind.h
                                  3                 :                :  *
                                  4                 :                :  *  Definitions related to the statistics kinds for the PostgreSQL
                                  5                 :                :  *  cumulative statistics system.  Can be included in backend or
                                  6                 :                :  *  frontend code.
                                  7                 :                :  *
                                  8                 :                :  *  Copyright (c) 2001-2026, PostgreSQL Global Development Group
                                  9                 :                :  *
                                 10                 :                :  *  src/include/utils/pgstat_kind.h
                                 11                 :                :  * ----------
                                 12                 :                :  */
                                 13                 :                : #ifndef PGSTAT_KIND_H
                                 14                 :                : #define PGSTAT_KIND_H
                                 15                 :                : 
                                 16                 :                : /* The types of statistics entries */
                                 17                 :                : #define PgStat_Kind uint32
                                 18                 :                : 
                                 19                 :                : /* Range of IDs allowed, for built-in and custom kinds */
                                 20                 :                : #define PGSTAT_KIND_MIN 1       /* Minimum ID allowed */
                                 21                 :                : #define PGSTAT_KIND_MAX 32      /* Maximum ID allowed */
                                 22                 :                : 
                                 23                 :                : /* use 0 for INVALID, to catch zero-initialized data */
                                 24                 :                : #define PGSTAT_KIND_INVALID 0
                                 25                 :                : 
                                 26                 :                : /* stats for variable-numbered objects */
                                 27                 :                : #define PGSTAT_KIND_DATABASE    1   /* database-wide statistics */
                                 28                 :                : #define PGSTAT_KIND_RELATION    2   /* per-table statistics */
                                 29                 :                : #define PGSTAT_KIND_INDEX       3   /* per-index statistics */
                                 30                 :                : #define PGSTAT_KIND_FUNCTION    4   /* per-function statistics */
                                 31                 :                : #define PGSTAT_KIND_REPLSLOT    5   /* per-slot statistics */
                                 32                 :                : #define PGSTAT_KIND_SUBSCRIPTION    6   /* per-subscription statistics */
                                 33                 :                : #define PGSTAT_KIND_BACKEND 7   /* per-backend statistics */
                                 34                 :                : 
                                 35                 :                : /* stats for fixed-numbered objects */
                                 36                 :                : #define PGSTAT_KIND_ARCHIVER    8
                                 37                 :                : #define PGSTAT_KIND_BGWRITER    9
                                 38                 :                : #define PGSTAT_KIND_CHECKPOINTER    10
                                 39                 :                : #define PGSTAT_KIND_IO  11
                                 40                 :                : #define PGSTAT_KIND_LOCK    12
                                 41                 :                : #define PGSTAT_KIND_SLRU    13
                                 42                 :                : #define PGSTAT_KIND_WAL 14
                                 43                 :                : 
                                 44                 :                : #define PGSTAT_KIND_BUILTIN_MIN PGSTAT_KIND_DATABASE
                                 45                 :                : #define PGSTAT_KIND_BUILTIN_MAX PGSTAT_KIND_WAL
                                 46                 :                : #define PGSTAT_KIND_BUILTIN_SIZE (PGSTAT_KIND_BUILTIN_MAX + 1)
                                 47                 :                : 
                                 48                 :                : /* Custom stats kinds */
                                 49                 :                : 
                                 50                 :                : /* Range of IDs allowed for custom stats kinds */
                                 51                 :                : #define PGSTAT_KIND_CUSTOM_MIN  24
                                 52                 :                : #define PGSTAT_KIND_CUSTOM_MAX  PGSTAT_KIND_MAX
                                 53                 :                : #define PGSTAT_KIND_CUSTOM_SIZE (PGSTAT_KIND_CUSTOM_MAX - PGSTAT_KIND_CUSTOM_MIN + 1)
                                 54                 :                : 
                                 55                 :                : /*
                                 56                 :                :  * PgStat_Kind to use for extensions that require an ID, but are still in
                                 57                 :                :  * development and have not reserved their own unique kind ID yet. See:
                                 58                 :                :  * https://wiki.postgresql.org/wiki/CustomCumulativeStats
                                 59                 :                :  */
                                 60                 :                : #define PGSTAT_KIND_EXPERIMENTAL    24
                                 61                 :                : 
                                 62                 :                : static inline bool
  614 michael@paquier.xyz        63                 :CBC    12004811 : pgstat_is_kind_builtin(PgStat_Kind kind)
                                 64                 :                : {
                                 65   [ +  -  +  + ]:       12004811 :     return kind >= PGSTAT_KIND_BUILTIN_MIN && kind <= PGSTAT_KIND_BUILTIN_MAX;
                                 66                 :                : }
                                 67                 :                : 
                                 68                 :                : static inline bool
                                 69                 :        1496183 : pgstat_is_kind_custom(PgStat_Kind kind)
                                 70                 :                : {
                                 71   [ +  +  +  - ]:        1496183 :     return kind >= PGSTAT_KIND_CUSTOM_MIN && kind <= PGSTAT_KIND_CUSTOM_MAX;
                                 72                 :                : }
                                 73                 :                : 
                                 74                 :                : #endif                          /* PGSTAT_KIND_H */
        

Generated by: LCOV version 2.0-1