xlogstats.h 981 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*-------------------------------------------------------------------------
  2. *
  3. * xlogstats.h
  4. * Definitions for WAL Statitstics
  5. *
  6. * Copyright (c) 2022, 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. #include "access/rmgr.h"
  16. #include "access/xlogreader.h"
  17. #define MAX_XLINFO_TYPES 16
  18. typedef struct XLogRecStats
  19. {
  20. uint64 count;
  21. uint64 rec_len;
  22. uint64 fpi_len;
  23. } XLogRecStats;
  24. typedef struct XLogStats
  25. {
  26. uint64 count;
  27. #ifdef FRONTEND
  28. XLogRecPtr startptr;
  29. XLogRecPtr endptr;
  30. #endif
  31. XLogRecStats rmgr_stats[RM_MAX_ID + 1];
  32. XLogRecStats record_stats[RM_MAX_ID + 1][MAX_XLINFO_TYPES];
  33. } XLogStats;
  34. extern void XLogRecGetLen(XLogReaderState *record, uint32 *rec_len,
  35. uint32 *fpi_len);
  36. extern void XLogRecStoreStats(XLogStats *stats, XLogReaderState *record);
  37. #endif /* XLOGSTATS_H */