Datum pg_stat_get_function_self_time(PG_FUNCTION_ARGS) { Oid funcid = PG_GETARG_OID(0); PgStat_StatFuncEntry *funcentry; if ((funcentry = pgstat_fetch_stat_funcentry(funcid)) == NULL) PG_RETURN_NULL(); PG_RETURN_INT64(funcentry->f_time_self); }
Datum pg_stat_get_function_self_time(PG_FUNCTION_ARGS) { Oid funcid = PG_GETARG_OID(0); PgStat_StatFuncEntry *funcentry; 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); }