diff options
Diffstat (limited to 'src/backend/utils/activity/pgstat_function.c')
-rw-r--r-- | src/backend/utils/activity/pgstat_function.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/src/backend/utils/activity/pgstat_function.c b/src/backend/utils/activity/pgstat_function.c index 0fdcefb7832..79e781167b0 100644 --- a/src/backend/utils/activity/pgstat_function.c +++ b/src/backend/utils/activity/pgstat_function.c @@ -124,13 +124,13 @@ pgstat_init_function_usage(FunctionCallInfo fcinfo, fcu->fs = pending; /* save stats for this function, later used to compensate for recursion */ - fcu->save_f_total_time = pending->f_total_time; + fcu->save_f_total_time = pending->total_time; /* save current backend-wide total time */ fcu->save_total = total_func_time; /* get clock time as of function start */ - INSTR_TIME_SET_CURRENT(fcu->f_start); + INSTR_TIME_SET_CURRENT(fcu->start); } /* @@ -146,41 +146,41 @@ void pgstat_end_function_usage(PgStat_FunctionCallUsage *fcu, bool finalize) { PgStat_FunctionCounts *fs = fcu->fs; - instr_time f_total; - instr_time f_others; - instr_time f_self; + instr_time total; + instr_time others; + instr_time self; /* stats not wanted? */ if (fs == NULL) return; /* total elapsed time in this function call */ - INSTR_TIME_SET_CURRENT(f_total); - INSTR_TIME_SUBTRACT(f_total, fcu->f_start); + INSTR_TIME_SET_CURRENT(total); + INSTR_TIME_SUBTRACT(total, fcu->start); /* self usage: elapsed minus anything already charged to other calls */ - f_others = total_func_time; - INSTR_TIME_SUBTRACT(f_others, fcu->save_total); - f_self = f_total; - INSTR_TIME_SUBTRACT(f_self, f_others); + others = total_func_time; + INSTR_TIME_SUBTRACT(others, fcu->save_total); + self = total; + INSTR_TIME_SUBTRACT(self, others); /* update backend-wide total time */ - INSTR_TIME_ADD(total_func_time, f_self); + INSTR_TIME_ADD(total_func_time, self); /* - * Compute the new f_total_time as the total elapsed time added to the - * pre-call value of f_total_time. This is necessary to avoid + * Compute the new total_time as the total elapsed time added to the + * pre-call value of total_time. This is necessary to avoid * double-counting any time taken by recursive calls of myself. (We do * not need any similar kluge for self time, since that already excludes * any recursive calls.) */ - INSTR_TIME_ADD(f_total, fcu->save_f_total_time); + INSTR_TIME_ADD(total, fcu->save_f_total_time); /* update counters in function stats table */ if (finalize) - fs->f_numcalls++; - fs->f_total_time = f_total; - INSTR_TIME_ADD(fs->f_self_time, f_self); + fs->numcalls++; + fs->total_time = total; + INSTR_TIME_ADD(fs->self_time, self); } /* @@ -203,11 +203,11 @@ pgstat_function_flush_cb(PgStat_EntryRef *entry_ref, bool nowait) if (!pgstat_lock_entry(entry_ref, nowait)) return false; - shfuncent->stats.f_numcalls += localent->f_numcalls; - shfuncent->stats.f_total_time += - INSTR_TIME_GET_MICROSEC(localent->f_total_time); - shfuncent->stats.f_self_time += - INSTR_TIME_GET_MICROSEC(localent->f_self_time); + shfuncent->stats.numcalls += localent->numcalls; + shfuncent->stats.total_time += + INSTR_TIME_GET_MICROSEC(localent->total_time); + shfuncent->stats.self_time += + INSTR_TIME_GET_MICROSEC(localent->self_time); pgstat_unlock_entry(entry_ref); |