summaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/pgstatfuncs.c
diff options
context:
space:
mode:
authorMichael Paquier2023-03-23 23:46:29 +0000
committerMichael Paquier2023-03-23 23:46:29 +0000
commit8089517ab8b547daab78f404f99eb48fba91ee9d (patch)
tree824d75d11cc4597dc1c2e005e5e56f0f25c3cb88 /src/backend/utils/adt/pgstatfuncs.c
parent11a0a8b529caeab101206ec4a33af95bb4445746 (diff)
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/[email protected]
Diffstat (limited to 'src/backend/utils/adt/pgstatfuncs.c')
-rw-r--r--src/backend/utils/adt/pgstatfuncs.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/backend/utils/adt/pgstatfuncs.c b/src/backend/utils/adt/pgstatfuncs.c
index 56119737c89..c7ba86b3dcc 100644
--- a/src/backend/utils/adt/pgstatfuncs.c
+++ b/src/backend/utils/adt/pgstatfuncs.c
@@ -149,7 +149,7 @@ pg_stat_get_function_calls(PG_FUNCTION_ARGS)
if ((funcentry = pgstat_fetch_stat_funcentry(funcid)) == NULL)
PG_RETURN_NULL();
- PG_RETURN_INT64(funcentry->f_numcalls);
+ PG_RETURN_INT64(funcentry->numcalls);
}
Datum
@@ -161,7 +161,7 @@ pg_stat_get_function_total_time(PG_FUNCTION_ARGS)
if ((funcentry = pgstat_fetch_stat_funcentry(funcid)) == NULL)
PG_RETURN_NULL();
/* convert counter from microsec to millisec for display */
- PG_RETURN_FLOAT8(((double) funcentry->f_total_time) / 1000.0);
+ PG_RETURN_FLOAT8(((double) funcentry->total_time) / 1000.0);
}
Datum
@@ -173,7 +173,7 @@ pg_stat_get_function_self_time(PG_FUNCTION_ARGS)
if ((funcentry = pgstat_fetch_stat_funcentry(funcid)) == NULL)
PG_RETURN_NULL();
/* convert counter from microsec to millisec for display */
- PG_RETURN_FLOAT8(((double) funcentry->f_self_time) / 1000.0);
+ PG_RETURN_FLOAT8(((double) funcentry->self_time) / 1000.0);
}
Datum
@@ -1508,7 +1508,7 @@ pg_stat_get_xact_numscans(PG_FUNCTION_ARGS)
if ((tabentry = find_tabstat_entry(relid)) == NULL)
result = 0;
else
- result = (int64) (tabentry->t_counts.t_numscans);
+ result = (int64) (tabentry->counts.numscans);
PG_RETURN_INT64(result);
}
@@ -1523,7 +1523,7 @@ pg_stat_get_xact_tuples_returned(PG_FUNCTION_ARGS)
if ((tabentry = find_tabstat_entry(relid)) == NULL)
result = 0;
else
- result = (int64) (tabentry->t_counts.t_tuples_returned);
+ result = (int64) (tabentry->counts.tuples_returned);
PG_RETURN_INT64(result);
}
@@ -1538,7 +1538,7 @@ pg_stat_get_xact_tuples_fetched(PG_FUNCTION_ARGS)
if ((tabentry = find_tabstat_entry(relid)) == NULL)
result = 0;
else
- result = (int64) (tabentry->t_counts.t_tuples_fetched);
+ result = (int64) (tabentry->counts.tuples_fetched);
PG_RETURN_INT64(result);
}
@@ -1555,8 +1555,8 @@ pg_stat_get_xact_tuples_inserted(PG_FUNCTION_ARGS)
result = 0;
else
{
- result = tabentry->t_counts.t_tuples_inserted;
- /* live subtransactions' counts aren't in t_tuples_inserted yet */
+ result = tabentry->counts.tuples_inserted;
+ /* live subtransactions' counts aren't in tuples_inserted yet */
for (trans = tabentry->trans; trans != NULL; trans = trans->upper)
result += trans->tuples_inserted;
}
@@ -1576,8 +1576,8 @@ pg_stat_get_xact_tuples_updated(PG_FUNCTION_ARGS)
result = 0;
else
{
- result = tabentry->t_counts.t_tuples_updated;
- /* live subtransactions' counts aren't in t_tuples_updated yet */
+ result = tabentry->counts.tuples_updated;
+ /* live subtransactions' counts aren't in tuples_updated yet */
for (trans = tabentry->trans; trans != NULL; trans = trans->upper)
result += trans->tuples_updated;
}
@@ -1597,8 +1597,8 @@ pg_stat_get_xact_tuples_deleted(PG_FUNCTION_ARGS)
result = 0;
else
{
- result = tabentry->t_counts.t_tuples_deleted;
- /* live subtransactions' counts aren't in t_tuples_deleted yet */
+ result = tabentry->counts.tuples_deleted;
+ /* live subtransactions' counts aren't in tuples_deleted yet */
for (trans = tabentry->trans; trans != NULL; trans = trans->upper)
result += trans->tuples_deleted;
}
@@ -1616,7 +1616,7 @@ pg_stat_get_xact_tuples_hot_updated(PG_FUNCTION_ARGS)
if ((tabentry = find_tabstat_entry(relid)) == NULL)
result = 0;
else
- result = (int64) (tabentry->t_counts.t_tuples_hot_updated);
+ result = (int64) (tabentry->counts.tuples_hot_updated);
PG_RETURN_INT64(result);
}
@@ -1631,7 +1631,7 @@ pg_stat_get_xact_tuples_newpage_updated(PG_FUNCTION_ARGS)
if ((tabentry = find_tabstat_entry(relid)) == NULL)
result = 0;
else
- result = (int64) (tabentry->t_counts.t_tuples_newpage_updated);
+ result = (int64) (tabentry->counts.tuples_newpage_updated);
PG_RETURN_INT64(result);
}
@@ -1646,7 +1646,7 @@ pg_stat_get_xact_blocks_fetched(PG_FUNCTION_ARGS)
if ((tabentry = find_tabstat_entry(relid)) == NULL)
result = 0;
else
- result = (int64) (tabentry->t_counts.t_blocks_fetched);
+ result = (int64) (tabentry->counts.blocks_fetched);
PG_RETURN_INT64(result);
}
@@ -1661,7 +1661,7 @@ pg_stat_get_xact_blocks_hit(PG_FUNCTION_ARGS)
if ((tabentry = find_tabstat_entry(relid)) == NULL)
result = 0;
else
- result = (int64) (tabentry->t_counts.t_blocks_hit);
+ result = (int64) (tabentry->counts.blocks_hit);
PG_RETURN_INT64(result);
}
@@ -1674,7 +1674,7 @@ pg_stat_get_xact_function_calls(PG_FUNCTION_ARGS)
if ((funcentry = find_funcstat_entry(funcid)) == NULL)
PG_RETURN_NULL();
- PG_RETURN_INT64(funcentry->f_numcalls);
+ PG_RETURN_INT64(funcentry->numcalls);
}
Datum
@@ -1685,7 +1685,7 @@ pg_stat_get_xact_function_total_time(PG_FUNCTION_ARGS)
if ((funcentry = find_funcstat_entry(funcid)) == NULL)
PG_RETURN_NULL();
- PG_RETURN_FLOAT8(INSTR_TIME_GET_MILLISEC(funcentry->f_total_time));
+ PG_RETURN_FLOAT8(INSTR_TIME_GET_MILLISEC(funcentry->total_time));
}
Datum
@@ -1696,7 +1696,7 @@ pg_stat_get_xact_function_self_time(PG_FUNCTION_ARGS)
if ((funcentry = find_funcstat_entry(funcid)) == NULL)
PG_RETURN_NULL();
- PG_RETURN_FLOAT8(INSTR_TIME_GET_MILLISEC(funcentry->f_self_time));
+ PG_RETURN_FLOAT8(INSTR_TIME_GET_MILLISEC(funcentry->self_time));
}