PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "fmgr.h"
#include "utils/inval.h"
#include "utils/pgstat_internal.h"
#include "utils/syscache.h"
Go to the source code of this file.
Functions | |
void | pgstat_create_function (Oid proid) |
void | pgstat_drop_function (Oid proid) |
void | pgstat_init_function_usage (FunctionCallInfo fcinfo, PgStat_FunctionCallUsage *fcu) |
void | pgstat_end_function_usage (PgStat_FunctionCallUsage *fcu, bool finalize) |
bool | pgstat_function_flush_cb (PgStat_EntryRef *entry_ref, bool nowait) |
PgStat_FunctionCounts * | find_funcstat_entry (Oid func_id) |
PgStat_StatFuncEntry * | pgstat_fetch_stat_funcentry (Oid func_id) |
Variables | |
int | pgstat_track_functions = TRACK_FUNC_OFF |
static instr_time | total_func_time |
PgStat_FunctionCounts* find_funcstat_entry | ( | Oid | func_id | ) |
Definition at line 223 of file pgstat_function.c.
References MyDatabaseId, PgStat_EntryRef::pending, pgstat_fetch_pending_entry(), and PGSTAT_KIND_FUNCTION.
Referenced by pg_stat_get_xact_function_calls().
void pgstat_create_function | ( | Oid | proid | ) |
Definition at line 45 of file pgstat_function.c.
References MyDatabaseId, pgstat_create_transactional(), and PGSTAT_KIND_FUNCTION.
Referenced by ProcedureCreate().
void pgstat_drop_function | ( | Oid | proid | ) |
Definition at line 60 of file pgstat_function.c.
References MyDatabaseId, pgstat_drop_transactional(), and PGSTAT_KIND_FUNCTION.
Referenced by RemoveFunctionById().
void pgstat_end_function_usage | ( | PgStat_FunctionCallUsage * | fcu, |
bool | finalize | ||
) |
Definition at line 146 of file pgstat_function.c.
References PgStat_FunctionCallUsage::fs, INSTR_TIME_ADD, INSTR_TIME_SET_CURRENT, INSTR_TIME_SUBTRACT, PgStat_FunctionCounts::numcalls, PgStat_FunctionCallUsage::save_f_total_time, PgStat_FunctionCallUsage::save_total, PgStat_FunctionCounts::self_time, PgStat_FunctionCallUsage::start, total_func_time, and PgStat_FunctionCounts::total_time.
Referenced by call_pltcl_start_proc(), EventTriggerInvoke(), ExecCallTriggerFunc(), ExecEvalFuncExprFusage(), ExecEvalFuncExprStrictFusage(), ExecMakeFunctionResultSet(), ExecMakeTableFunctionResult(), ExecuteCallStmt(), and fmgr_security_definer().
PgStat_StatFuncEntry* pgstat_fetch_stat_funcentry | ( | Oid | func_id | ) |
Definition at line 239 of file pgstat_function.c.
References MyDatabaseId, pgstat_fetch_entry(), and PGSTAT_KIND_FUNCTION.
Referenced by pg_stat_get_function_calls().
bool pgstat_function_flush_cb | ( | PgStat_EntryRef * | entry_ref, |
bool | nowait | ||
) |
Definition at line 193 of file pgstat_function.c.
References INSTR_TIME_GET_MICROSEC, PgStat_FunctionCounts::numcalls, PgStat_StatFuncEntry::numcalls, PgStat_EntryRef::pending, pgstat_lock_entry(), pgstat_unlock_entry(), PgStat_FunctionCounts::self_time, PgStat_StatFuncEntry::self_time, PgStat_EntryRef::shared_stats, PgStatShared_Function::stats, PgStat_FunctionCounts::total_time, and PgStat_StatFuncEntry::total_time.
void pgstat_init_function_usage | ( | FunctionCallInfo | fcinfo, |
PgStat_FunctionCallUsage * | fcu | ||
) |
Definition at line 72 of file pgstat_function.c.
References AcceptInvalidationMessages(), ereport, errcode(), errmsg(), ERROR, FunctionCallInfoBaseData::flinfo, FmgrInfo::fn_oid, PgStat_FunctionCallUsage::fs, INSTR_TIME_SET_CURRENT, MyDatabaseId, ObjectIdGetDatum(), PgStat_EntryRef::pending, pgstat_drop_entry(), PGSTAT_KIND_FUNCTION, pgstat_prep_pending_entry(), PgStat_FunctionCallUsage::save_f_total_time, PgStat_FunctionCallUsage::save_total, SearchSysCacheExists1, PgStat_FunctionCallUsage::start, total_func_time, and PgStat_FunctionCounts::total_time.
Referenced by call_pltcl_start_proc(), EventTriggerInvoke(), ExecCallTriggerFunc(), ExecEvalFuncExprFusage(), ExecEvalFuncExprStrictFusage(), ExecMakeFunctionResultSet(), ExecMakeTableFunctionResult(), ExecuteCallStmt(), and fmgr_security_definer().
int pgstat_track_functions = TRACK_FUNC_OFF |
Definition at line 30 of file pgstat_function.c.
|
static |
Definition at line 38 of file pgstat_function.c.
Referenced by pgstat_end_function_usage(), and pgstat_init_function_usage().