|
PostgreSQL Source Code git master
|
#include "postgres.h"#include "common/hashfn.h"#include "funcapi.h"#include "utils/builtins.h"#include "utils/pgstat_internal.h"
Go to the source code of this file.
Data Structures | |
| struct | PgStat_StatCustomVarEntry |
| struct | PgStatShared_CustomVarEntry |
Macros | |
| #define | PGSTAT_KIND_TEST_CUSTOM_VAR_STATS 25 |
| #define | PGSTAT_CUSTOM_VAR_STATS_IDX(name) hash_bytes_extended((const unsigned char *) name, strlen(name), 0) |
Typedefs | |
| typedef struct PgStat_StatCustomVarEntry | PgStat_StatCustomVarEntry |
| typedef struct PgStatShared_CustomVarEntry | PgStatShared_CustomVarEntry |
Functions | |
| PG_MODULE_MAGIC_EXT (.name="test_custom_var_stats",.version=PG_VERSION) | |
| static bool | test_custom_stats_var_flush_pending_cb (PgStat_EntryRef *entry_ref, bool nowait) |
| void | _PG_init (void) |
| static PgStat_StatCustomVarEntry * | test_custom_stats_var_fetch_entry (const char *stat_name) |
| PG_FUNCTION_INFO_V1 (test_custom_stats_var_create) | |
| Datum | test_custom_stats_var_create (PG_FUNCTION_ARGS) |
| PG_FUNCTION_INFO_V1 (test_custom_stats_var_update) | |
| Datum | test_custom_stats_var_update (PG_FUNCTION_ARGS) |
| PG_FUNCTION_INFO_V1 (test_custom_stats_var_drop) | |
| Datum | test_custom_stats_var_drop (PG_FUNCTION_ARGS) |
| PG_FUNCTION_INFO_V1 (test_custom_stats_var_report) | |
| Datum | test_custom_stats_var_report (PG_FUNCTION_ARGS) |
Variables | |
| static const PgStat_KindInfo | custom_stats |
| #define PGSTAT_CUSTOM_VAR_STATS_IDX | ( | name | ) | hash_bytes_extended((const unsigned char *) name, strlen(name), 0) |
Definition at line 38 of file test_custom_var_stats.c.
| #define PGSTAT_KIND_TEST_CUSTOM_VAR_STATS 25 |
Definition at line 33 of file test_custom_var_stats.c.
| typedef struct PgStat_StatCustomVarEntry PgStat_StatCustomVarEntry |
| typedef struct PgStatShared_CustomVarEntry PgStatShared_CustomVarEntry |
| void _PG_init | ( | void | ) |
Definition at line 91 of file test_custom_var_stats.c.
References custom_stats, PGSTAT_KIND_TEST_CUSTOM_VAR_STATS, pgstat_register_kind(), and process_shared_preload_libraries_in_progress.
| PG_FUNCTION_INFO_V1 | ( | test_custom_stats_var_create | ) |
| PG_FUNCTION_INFO_V1 | ( | test_custom_stats_var_drop | ) |
| PG_FUNCTION_INFO_V1 | ( | test_custom_stats_var_report | ) |
| PG_FUNCTION_INFO_V1 | ( | test_custom_stats_var_update | ) |
| PG_MODULE_MAGIC_EXT | ( | . | name = "test_custom_var_stats", |
| . | version = PG_VERSION |
||
| ) |
| Datum test_custom_stats_var_create | ( | PG_FUNCTION_ARGS | ) |
Definition at line 170 of file test_custom_var_stats.c.
References ereport, errcode(), errdetail(), errmsg(), ERROR, InvalidOid, NAMEDATALEN, PG_GETARG_TEXT_PP, PG_RETURN_VOID, PGSTAT_CUSTOM_VAR_STATS_IDX, pgstat_get_entry_ref_locked(), PGSTAT_KIND_TEST_CUSTOM_VAR_STATS, pgstat_unlock_entry(), PgStat_EntryRef::shared_stats, PgStatShared_CustomVarEntry::stats, and text_to_cstring().
| Datum test_custom_stats_var_drop | ( | PG_FUNCTION_ARGS | ) |
Definition at line 234 of file test_custom_var_stats.c.
References InvalidOid, PG_GETARG_TEXT_PP, PG_RETURN_VOID, PGSTAT_CUSTOM_VAR_STATS_IDX, pgstat_drop_entry(), PGSTAT_KIND_TEST_CUSTOM_VAR_STATS, pgstat_request_entry_refs_gc(), and text_to_cstring().
|
static |
Definition at line 147 of file test_custom_var_stats.c.
References InvalidOid, PGSTAT_CUSTOM_VAR_STATS_IDX, pgstat_fetch_entry(), and PGSTAT_KIND_TEST_CUSTOM_VAR_STATS.
Referenced by test_custom_stats_var_report().
|
static |
Definition at line 116 of file test_custom_var_stats.c.
References PgStat_StatCustomVarEntry::numcalls, PgStat_EntryRef::pending, pgstat_lock_entry(), pgstat_unlock_entry(), PgStat_EntryRef::shared_stats, and PgStatShared_CustomVarEntry::stats.
| Datum test_custom_stats_var_report | ( | PG_FUNCTION_ARGS | ) |
Definition at line 255 of file test_custom_var_stats.c.
References BlessTupleDesc(), FuncCallContext::call_cntr, cstring_to_text(), elog, ERROR, get_call_result_type(), heap_form_tuple(), HeapTupleGetDatum(), Int64GetDatum(), FuncCallContext::max_calls, MemoryContextSwitchTo(), FuncCallContext::multi_call_memory_ctx, PgStat_StatCustomVarEntry::numcalls, PG_GETARG_TEXT_PP, PointerGetDatum(), SRF_FIRSTCALL_INIT, SRF_IS_FIRSTCALL, SRF_PERCALL_SETUP, SRF_RETURN_DONE, SRF_RETURN_NEXT, test_custom_stats_var_fetch_entry(), text_to_cstring(), FuncCallContext::tuple_desc, TYPEFUNC_COMPOSITE, and values.
| Datum test_custom_stats_var_update | ( | PG_FUNCTION_ARGS | ) |
Definition at line 209 of file test_custom_var_stats.c.
References InvalidOid, PgStat_StatCustomVarEntry::numcalls, PgStat_EntryRef::pending, PG_GETARG_TEXT_PP, PG_RETURN_VOID, PGSTAT_CUSTOM_VAR_STATS_IDX, PGSTAT_KIND_TEST_CUSTOM_VAR_STATS, pgstat_prep_pending_entry(), and text_to_cstring().
|
static |
Definition at line 72 of file test_custom_var_stats.c.
Referenced by _PG_init().