summaryrefslogtreecommitdiff
path: root/src/backend/utils/activity/pgstat_relation.c
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2022-12-07 09:11:48 +0900
committerMichael Paquier <michael@paquier.xyz>2022-12-07 09:11:48 +0900
commit8018ffbf5895ee16a1fd7117c4526b47ac42332e (patch)
tree07c7c6139a2c909da53488f9799d17541ec83c41 /src/backend/utils/activity/pgstat_relation.c
parent79f7c482f6745959f7aeea4f7386fceb02ad8889 (diff)
downloadpostgresql-8018ffbf5895ee16a1fd7117c4526b47ac42332e.tar.gz
Generate pg_stat_get*() functions for databases using macros
The same code pattern is repeated 21 times for int64 counters (0 for missing entry) and 5 times for doubles (0 for missing entry) on database entries. This code is switched to use macros for the basic code instead, shaving a few hundred lines of originally-duplicated code patterns. The function names remain the same, but some fields of PgStat_StatDBEntry have to be renamed to cope with the new style. This is in the same spirit as 83a1a1b. Author: Michael Paquier Reviewed-by: Nathan Bossart, Bertrand Drouvot Discussion: https://postgr.es/m/Y46stlxQ2LQE20Na@paquier.xyz
Diffstat (limited to 'src/backend/utils/activity/pgstat_relation.c')
-rw-r--r--src/backend/utils/activity/pgstat_relation.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/backend/utils/activity/pgstat_relation.c b/src/backend/utils/activity/pgstat_relation.c
index a9c05153d9..f9788c30ae 100644
--- a/src/backend/utils/activity/pgstat_relation.c
+++ b/src/backend/utils/activity/pgstat_relation.c
@@ -819,13 +819,13 @@ pgstat_relation_flush_cb(PgStat_EntryRef *entry_ref, bool nowait)
/* The entry was successfully flushed, add the same to database stats */
dbentry = pgstat_prep_database_pending(dboid);
- dbentry->n_tuples_returned += lstats->t_counts.t_tuples_returned;
- dbentry->n_tuples_fetched += lstats->t_counts.t_tuples_fetched;
- dbentry->n_tuples_inserted += lstats->t_counts.t_tuples_inserted;
- dbentry->n_tuples_updated += lstats->t_counts.t_tuples_updated;
- dbentry->n_tuples_deleted += lstats->t_counts.t_tuples_deleted;
- dbentry->n_blocks_fetched += lstats->t_counts.t_blocks_fetched;
- dbentry->n_blocks_hit += lstats->t_counts.t_blocks_hit;
+ dbentry->tuples_returned += lstats->t_counts.t_tuples_returned;
+ dbentry->tuples_fetched += lstats->t_counts.t_tuples_fetched;
+ dbentry->tuples_inserted += lstats->t_counts.t_tuples_inserted;
+ dbentry->tuples_updated += lstats->t_counts.t_tuples_updated;
+ dbentry->tuples_deleted += lstats->t_counts.t_tuples_deleted;
+ dbentry->blocks_fetched += lstats->t_counts.t_blocks_fetched;
+ dbentry->blocks_hit += lstats->t_counts.t_blocks_hit;
return true;
}