PostgreSQL Source Code  git master
xlogstats.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * xlogstats.h
4  * Definitions for WAL Statitstics
5  *
6  * Copyright (c) 2022-2024, PostgreSQL Global Development Group
7  *
8  * IDENTIFICATION
9  * src/include/access/xlogstats.h
10  *
11  *-------------------------------------------------------------------------
12  */
13 #ifndef XLOGSTATS_H
14 #define XLOGSTATS_H
15 
16 #include "access/rmgr.h"
17 #include "access/xlogreader.h"
18 
19 #define MAX_XLINFO_TYPES 16
20 
21 typedef struct XLogRecStats
22 {
23  uint64 count;
24  uint64 rec_len;
25  uint64 fpi_len;
27 
28 typedef struct XLogStats
29 {
30  uint64 count;
31 #ifdef FRONTEND
32  XLogRecPtr startptr;
33  XLogRecPtr endptr;
34 #endif
38 
39 extern void XLogRecGetLen(XLogReaderState *record, uint32 *rec_len,
40  uint32 *fpi_len);
41 extern void XLogRecStoreStats(XLogStats *stats, XLogReaderState *record);
42 
43 #endif /* XLOGSTATS_H */
unsigned int uint32
Definition: c.h:492
#define RM_MAX_ID
Definition: rmgr.h:33
uint64 count
Definition: xlogstats.h:23
uint64 fpi_len
Definition: xlogstats.h:25
uint64 rec_len
Definition: xlogstats.h:24
XLogRecStats record_stats[RM_MAX_ID+1][MAX_XLINFO_TYPES]
Definition: xlogstats.h:36
uint64 count
Definition: xlogstats.h:30
XLogRecStats rmgr_stats[RM_MAX_ID+1]
Definition: xlogstats.h:35
uint64 XLogRecPtr
Definition: xlogdefs.h:21
void XLogRecStoreStats(XLogStats *stats, XLogReaderState *record)
Definition: xlogstats.c:54
struct XLogStats XLogStats
void XLogRecGetLen(XLogReaderState *record, uint32 *rec_len, uint32 *fpi_len)
Definition: xlogstats.c:22
struct XLogRecStats XLogRecStats
#define MAX_XLINFO_TYPES
Definition: xlogstats.h:19