23 .
name =
"test_custom_fixed_stats",
48 .
name =
"test_custom_fixed_stats",
50 .write_to_file =
true,
64#define PGSTAT_KIND_TEST_CUSTOM_FIXED_STATS 26
109 sizeof(stats_shmem->
stats),
131 sizeof(stats_shmem->
stats),
135 memcpy(&
reset, reset_offset,
sizeof(stats_shmem->
stats));
139#define FIXED_COMP(fld) stat_snap->fld -= reset.fld;
195 bool nulls[2] = {
false};
207 TIMESTAMPTZOID, -1, 0);
static Datum values[MAXATTR]
TupleDesc BlessTupleDesc(TupleDesc tupdesc)
#define PG_RETURN_DATUM(x)
static Datum HeapTupleGetDatum(const HeapTupleData *tuple)
HeapTuple heap_form_tuple(TupleDesc tupleDescriptor, const Datum *values, const bool *isnull)
bool LWLockAcquire(LWLock *lock, LWLockMode mode)
void LWLockRelease(LWLock *lock)
void LWLockInitialize(LWLock *lock, int tranche_id)
bool process_shared_preload_libraries_in_progress
void pgstat_snapshot_fixed(PgStat_Kind kind)
void pgstat_reset_of_kind(PgStat_Kind kind)
void pgstat_register_kind(PgStat_Kind kind, const PgStat_KindInfo *kind_info)
static void * pgstat_get_custom_snapshot_data(PgStat_Kind kind)
static void * pgstat_get_custom_shmem_data(PgStat_Kind kind)
static void pgstat_end_changecount_write(uint32 *cc)
static void pgstat_begin_changecount_write(uint32 *cc)
static void pgstat_copy_changecounted_stats(void *dst, void *src, size_t len, uint32 *cc)
static Datum Int64GetDatum(int64 X)
PgStat_StatCustomFixedEntry reset_offset
PgStat_StatCustomFixedEntry stats
TimestampTz stat_reset_timestamp
#define PGSTAT_KIND_TEST_CUSTOM_FIXED_STATS
Datum test_custom_stats_fixed_reset(PG_FUNCTION_ARGS)
static const PgStat_KindInfo custom_stats
static void test_custom_stats_fixed_init_shmem_cb(void *stats)
static void test_custom_stats_fixed_snapshot_cb(void)
static void test_custom_stats_fixed_reset_all_cb(TimestampTz ts)
struct PgStatShared_CustomFixedEntry PgStatShared_CustomFixedEntry
PG_FUNCTION_INFO_V1(test_custom_stats_fixed_update)
Datum test_custom_stats_fixed_update(PG_FUNCTION_ARGS)
Datum test_custom_stats_fixed_report(PG_FUNCTION_ARGS)
struct PgStat_StatCustomFixedEntry PgStat_StatCustomFixedEntry
PG_MODULE_MAGIC_EXT(.name="test_custom_fixed_stats",.version=PG_VERSION)
TupleDesc CreateTemplateTupleDesc(int natts)
void TupleDescInitEntry(TupleDesc desc, AttrNumber attributeNumber, const char *attributeName, Oid oidtypeid, int32 typmod, int attdim)
static Datum TimestampTzGetDatum(TimestampTz X)