diff options
author | Michael Paquier <michael@paquier.xyz> | 2023-03-24 08:46:29 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2023-03-24 08:46:29 +0900 |
commit | 8089517ab8b547daab78f404f99eb48fba91ee9d (patch) | |
tree | 824d75d11cc4597dc1c2e005e5e56f0f25c3cb88 /src/include/pgstat.h | |
parent | 11a0a8b529caeab101206ec4a33af95bb4445746 (diff) | |
download | postgresql-8089517ab8b547daab78f404f99eb48fba91ee9d.tar.gz postgresql-8089517ab8b547daab78f404f99eb48fba91ee9d.zip |
Rename fields in pgstat structures for functions and relations
This commit renames the members of a few pgstat structures related to
functions and relations, by respectively removing their prefix "f_" and
"t_". The statistics for functions and relations and handled in their
own file, and pgstatfuncs.c associates each field in a structure
variable named based on the object type handled, so no information is
lost with this rename.
This will help with some of the refactoring aimed for pgstatfuncs.c, as
this makes more consistent the field names with the SQL functions
retrieving them.
Author: Bertrand Drouvot
Reviewed-by: Michael Paquier, Melanie Plageman
Discussion: https://postgr.es/m/9142f62a-a422-145c-bde0-b5bc498a4ada@gmail.com
Diffstat (limited to 'src/include/pgstat.h')
-rw-r--r-- | src/include/pgstat.h | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/src/include/pgstat.h b/src/include/pgstat.h index 6dd14004beb..c2bae8358a2 100644 --- a/src/include/pgstat.h +++ b/src/include/pgstat.h @@ -106,9 +106,9 @@ typedef int64 PgStat_Counter; */ typedef struct PgStat_FunctionCounts { - PgStat_Counter f_numcalls; - instr_time f_total_time; - instr_time f_self_time; + PgStat_Counter numcalls; + instr_time total_time; + instr_time self_time; } PgStat_FunctionCounts; /* @@ -124,7 +124,7 @@ typedef struct PgStat_FunctionCallUsage /* Backend-wide total time as of function start */ instr_time save_total; /* system clock as of function start */ - instr_time f_start; + instr_time start; } PgStat_FunctionCallUsage; /* ---------- @@ -159,24 +159,24 @@ typedef struct PgStat_BackendSubEntry */ typedef struct PgStat_TableCounts { - PgStat_Counter t_numscans; + PgStat_Counter numscans; - PgStat_Counter t_tuples_returned; - PgStat_Counter t_tuples_fetched; + PgStat_Counter tuples_returned; + PgStat_Counter tuples_fetched; - PgStat_Counter t_tuples_inserted; - PgStat_Counter t_tuples_updated; - PgStat_Counter t_tuples_deleted; - PgStat_Counter t_tuples_hot_updated; - PgStat_Counter t_tuples_newpage_updated; - bool t_truncdropped; + PgStat_Counter tuples_inserted; + PgStat_Counter tuples_updated; + PgStat_Counter tuples_deleted; + PgStat_Counter tuples_hot_updated; + PgStat_Counter tuples_newpage_updated; + bool truncdropped; - PgStat_Counter t_delta_live_tuples; - PgStat_Counter t_delta_dead_tuples; - PgStat_Counter t_changed_tuples; + PgStat_Counter delta_live_tuples; + PgStat_Counter delta_dead_tuples; + PgStat_Counter changed_tuples; - PgStat_Counter t_blocks_fetched; - PgStat_Counter t_blocks_hit; + PgStat_Counter blocks_fetched; + PgStat_Counter blocks_hit; } PgStat_TableCounts; /* ---------- @@ -196,10 +196,10 @@ typedef struct PgStat_TableCounts */ typedef struct PgStat_TableStatus { - Oid t_id; /* table's OID */ - bool t_shared; /* is it a shared catalog? */ + Oid id; /* table's OID */ + bool shared; /* is it a shared catalog? */ struct PgStat_TableXactStatus *trans; /* lowest subxact's counts */ - PgStat_TableCounts t_counts; /* event counts to be sent */ + PgStat_TableCounts counts; /* event counts to be sent */ Relation relation; /* rel that is using this entry */ } PgStat_TableStatus; @@ -352,10 +352,10 @@ typedef struct PgStat_StatDBEntry typedef struct PgStat_StatFuncEntry { - PgStat_Counter f_numcalls; + PgStat_Counter numcalls; - PgStat_Counter f_total_time; /* times in microseconds */ - PgStat_Counter f_self_time; + PgStat_Counter total_time; /* times in microseconds */ + PgStat_Counter self_time; } PgStat_StatFuncEntry; typedef struct PgStat_StatReplSlotEntry @@ -584,37 +584,37 @@ extern void pgstat_report_analyze(Relation rel, #define pgstat_count_heap_scan(rel) \ do { \ if (pgstat_should_count_relation(rel)) \ - (rel)->pgstat_info->t_counts.t_numscans++; \ + (rel)->pgstat_info->counts.numscans++; \ } while (0) #define pgstat_count_heap_getnext(rel) \ do { \ if (pgstat_should_count_relation(rel)) \ - (rel)->pgstat_info->t_counts.t_tuples_returned++; \ + (rel)->pgstat_info->counts.tuples_returned++; \ } while (0) #define pgstat_count_heap_fetch(rel) \ do { \ if (pgstat_should_count_relation(rel)) \ - (rel)->pgstat_info->t_counts.t_tuples_fetched++; \ + (rel)->pgstat_info->counts.tuples_fetched++; \ } while (0) #define pgstat_count_index_scan(rel) \ do { \ if (pgstat_should_count_relation(rel)) \ - (rel)->pgstat_info->t_counts.t_numscans++; \ + (rel)->pgstat_info->counts.numscans++; \ } while (0) #define pgstat_count_index_tuples(rel, n) \ do { \ if (pgstat_should_count_relation(rel)) \ - (rel)->pgstat_info->t_counts.t_tuples_returned += (n); \ + (rel)->pgstat_info->counts.tuples_returned += (n); \ } while (0) #define pgstat_count_buffer_read(rel) \ do { \ if (pgstat_should_count_relation(rel)) \ - (rel)->pgstat_info->t_counts.t_blocks_fetched++; \ + (rel)->pgstat_info->counts.blocks_fetched++; \ } while (0) #define pgstat_count_buffer_hit(rel) \ do { \ if (pgstat_should_count_relation(rel)) \ - (rel)->pgstat_info->t_counts.t_blocks_hit++; \ + (rel)->pgstat_info->counts.blocks_hit++; \ } while (0) extern void pgstat_count_heap_insert(Relation rel, PgStat_Counter n); |