PostgreSQL Source Code
git master
|
#include "portability/instr_time.h"
Go to the source code of this file.
Data Structures | |
struct | BufferUsage |
struct | WalUsage |
struct | Instrumentation |
struct | WorkerInstrumentation |
Typedefs | |
typedef struct BufferUsage | BufferUsage |
typedef struct WalUsage | WalUsage |
typedef enum InstrumentOption | InstrumentOption |
typedef struct Instrumentation | Instrumentation |
typedef struct WorkerInstrumentation | WorkerInstrumentation |
Enumerations | |
enum | InstrumentOption { INSTRUMENT_TIMER = 1 << 0 , INSTRUMENT_BUFFERS = 1 << 1 , INSTRUMENT_ROWS = 1 << 2 , INSTRUMENT_WAL = 1 << 3 , INSTRUMENT_ALL = PG_INT32_MAX } |
Functions | |
Instrumentation * | InstrAlloc (int n, int instrument_options, bool async_mode) |
void | InstrInit (Instrumentation *instr, int instrument_options) |
void | InstrStartNode (Instrumentation *instr) |
void | InstrStopNode (Instrumentation *instr, double nTuples) |
void | InstrUpdateTupleCount (Instrumentation *instr, double nTuples) |
void | InstrEndLoop (Instrumentation *instr) |
void | InstrAggNode (Instrumentation *dst, Instrumentation *add) |
void | InstrStartParallelQuery (void) |
void | InstrEndParallelQuery (BufferUsage *bufusage, WalUsage *walusage) |
void | InstrAccumParallelQuery (BufferUsage *bufusage, WalUsage *walusage) |
void | BufferUsageAccumDiff (BufferUsage *dst, const BufferUsage *add, const BufferUsage *sub) |
void | WalUsageAccumDiff (WalUsage *dst, const WalUsage *add, const WalUsage *sub) |
Variables | |
PGDLLIMPORT BufferUsage | pgBufferUsage |
PGDLLIMPORT WalUsage | pgWalUsage |
typedef struct BufferUsage BufferUsage |
typedef struct Instrumentation Instrumentation |
typedef enum InstrumentOption InstrumentOption |
typedef struct WorkerInstrumentation WorkerInstrumentation |
enum InstrumentOption |
Enumerator | |
---|---|
INSTRUMENT_TIMER | |
INSTRUMENT_BUFFERS | |
INSTRUMENT_ROWS | |
INSTRUMENT_WAL | |
INSTRUMENT_ALL |
Definition at line 59 of file instrument.h.
void BufferUsageAccumDiff | ( | BufferUsage * | dst, |
const BufferUsage * | add, | ||
const BufferUsage * | sub | ||
) |
Definition at line 248 of file instrument.c.
References INSTR_TIME_ACCUM_DIFF, BufferUsage::local_blk_read_time, BufferUsage::local_blk_write_time, BufferUsage::local_blks_dirtied, BufferUsage::local_blks_hit, BufferUsage::local_blks_read, BufferUsage::local_blks_written, BufferUsage::shared_blk_read_time, BufferUsage::shared_blk_write_time, BufferUsage::shared_blks_dirtied, BufferUsage::shared_blks_hit, BufferUsage::shared_blks_read, BufferUsage::shared_blks_written, BufferUsage::temp_blk_read_time, BufferUsage::temp_blk_write_time, BufferUsage::temp_blks_read, and BufferUsage::temp_blks_written.
Referenced by do_analyze_rel(), ExplainExecuteQuery(), heap_vacuum_rel(), InstrEndParallelQuery(), InstrStopNode(), pgss_planner(), pgss_ProcessUtility(), serializeAnalyzeReceive(), and standard_ExplainOneQuery().
void InstrAccumParallelQuery | ( | BufferUsage * | bufusage, |
WalUsage * | walusage | ||
) |
Definition at line 218 of file instrument.c.
References BufferUsageAdd(), pgBufferUsage, pgWalUsage, and WalUsageAdd().
Referenced by _brin_end_parallel(), _bt_end_parallel(), ExecParallelFinish(), and parallel_vacuum_process_all_indexes().
void InstrAggNode | ( | Instrumentation * | dst, |
Instrumentation * | add | ||
) |
Definition at line 169 of file instrument.c.
References BufferUsageAdd(), Instrumentation::bufusage, Instrumentation::counter, Instrumentation::firsttuple, INSTR_TIME_ADD, Instrumentation::need_bufusage, Instrumentation::need_walusage, Instrumentation::nfiltered1, Instrumentation::nfiltered2, Instrumentation::nloops, Instrumentation::ntuples, Instrumentation::ntuples2, Instrumentation::running, Instrumentation::startup, Instrumentation::total, Instrumentation::tuplecount, Instrumentation::walusage, and WalUsageAdd().
Referenced by ExecParallelReportInstrumentation(), and ExecParallelRetrieveInstrumentation().
Instrumentation* InstrAlloc | ( | int | n, |
int | instrument_options, | ||
bool | async_mode | ||
) |
Definition at line 31 of file instrument.c.
References Instrumentation::async_mode, i, INSTRUMENT_BUFFERS, INSTRUMENT_TIMER, INSTRUMENT_WAL, Instrumentation::need_bufusage, Instrumentation::need_timer, Instrumentation::need_walusage, and palloc0().
Referenced by ExecInitNode(), explain_ExecutorStart(), InitResultRelInfo(), and pgss_ExecutorStart().
void InstrEndLoop | ( | Instrumentation * | instr | ) |
Definition at line 140 of file instrument.c.
References Instrumentation::counter, elog, ERROR, Instrumentation::firsttuple, INSTR_TIME_GET_DOUBLE, INSTR_TIME_IS_ZERO, INSTR_TIME_SET_ZERO, Instrumentation::nloops, Instrumentation::ntuples, Instrumentation::running, Instrumentation::starttime, Instrumentation::startup, Instrumentation::total, and Instrumentation::tuplecount.
Referenced by ExecParallelReportInstrumentation(), ExecReScan(), explain_ExecutorEnd(), ExplainNode(), pgss_ExecutorEnd(), report_triggers(), and show_modifytable_info().
void InstrEndParallelQuery | ( | BufferUsage * | bufusage, |
WalUsage * | walusage | ||
) |
Definition at line 208 of file instrument.c.
References BufferUsageAccumDiff(), pgBufferUsage, pgWalUsage, save_pgBufferUsage, save_pgWalUsage, and WalUsageAccumDiff().
Referenced by _brin_parallel_build_main(), _bt_parallel_build_main(), parallel_vacuum_main(), and ParallelQueryMain().
void InstrInit | ( | Instrumentation * | instr, |
int | instrument_options | ||
) |
Definition at line 58 of file instrument.c.
References INSTRUMENT_BUFFERS, INSTRUMENT_TIMER, INSTRUMENT_WAL, Instrumentation::need_bufusage, Instrumentation::need_timer, and Instrumentation::need_walusage.
Referenced by ExecInitParallelPlan().
void InstrStartNode | ( | Instrumentation * | instr | ) |
Definition at line 68 of file instrument.c.
References Instrumentation::bufusage_start, elog, ERROR, INSTR_TIME_SET_CURRENT_LAZY, Instrumentation::need_bufusage, Instrumentation::need_timer, Instrumentation::need_walusage, pgBufferUsage, pgWalUsage, Instrumentation::starttime, and Instrumentation::walusage_start.
Referenced by AfterTriggerExecute(), ExecAsyncConfigureWait(), ExecAsyncNotify(), ExecAsyncRequest(), ExecCallTriggerFunc(), ExecProcNodeInstr(), ExecShutdownNode_walker(), MultiExecBitmapAnd(), MultiExecBitmapIndexScan(), MultiExecBitmapOr(), MultiExecHash(), standard_ExecutorFinish(), and standard_ExecutorRun().
void InstrStartParallelQuery | ( | void | ) |
Definition at line 200 of file instrument.c.
References pgBufferUsage, pgWalUsage, save_pgBufferUsage, and save_pgWalUsage.
Referenced by _brin_parallel_build_main(), _bt_parallel_build_main(), parallel_vacuum_main(), and ParallelQueryMain().
void InstrStopNode | ( | Instrumentation * | instr, |
double | nTuples | ||
) |
Definition at line 84 of file instrument.c.
References Instrumentation::async_mode, BufferUsageAccumDiff(), Instrumentation::bufusage, Instrumentation::bufusage_start, Instrumentation::counter, elog, ERROR, Instrumentation::firsttuple, INSTR_TIME_ACCUM_DIFF, INSTR_TIME_GET_DOUBLE, INSTR_TIME_IS_ZERO, INSTR_TIME_SET_CURRENT, INSTR_TIME_SET_ZERO, Instrumentation::need_bufusage, Instrumentation::need_timer, Instrumentation::need_walusage, pgBufferUsage, pgWalUsage, Instrumentation::running, Instrumentation::starttime, Instrumentation::tuplecount, Instrumentation::walusage, Instrumentation::walusage_start, and WalUsageAccumDiff().
Referenced by AfterTriggerExecute(), ExecAsyncConfigureWait(), ExecAsyncNotify(), ExecAsyncRequest(), ExecCallTriggerFunc(), ExecProcNodeInstr(), ExecShutdownNode_walker(), MultiExecBitmapAnd(), MultiExecBitmapIndexScan(), MultiExecBitmapOr(), MultiExecHash(), standard_ExecutorFinish(), and standard_ExecutorRun().
void InstrUpdateTupleCount | ( | Instrumentation * | instr, |
double | nTuples | ||
) |
Definition at line 132 of file instrument.c.
References Instrumentation::tuplecount.
Referenced by complete_pending_request().
Definition at line 286 of file instrument.c.
References WalUsage::wal_bytes, WalUsage::wal_fpi, and WalUsage::wal_records.
Referenced by do_analyze_rel(), heap_vacuum_rel(), InstrEndParallelQuery(), InstrStopNode(), pgss_planner(), pgss_ProcessUtility(), and pgstat_wal_flush_cb().
|
extern |
Definition at line 20 of file instrument.c.
Referenced by BufFileDumpBuffer(), BufFileLoadBuffer(), do_analyze_rel(), ExplainExecuteQuery(), ExtendBufferedRelLocal(), ExtendBufferedRelShared(), FlushBuffer(), FlushRelationBuffers(), GetLocalVictimBuffer(), heap_vacuum_rel(), InstrAccumParallelQuery(), InstrEndParallelQuery(), InstrStartNode(), InstrStartParallelQuery(), InstrStopNode(), MarkBufferDirty(), MarkBufferDirtyHint(), MarkLocalBufferDirty(), pgss_planner(), pgss_ProcessUtility(), pgstat_count_io_op_time(), PinBufferForBlock(), ReadRecentBuffer(), serializeAnalyzeReceive(), standard_ExplainOneQuery(), and WaitReadBuffers().
|
extern |
Definition at line 22 of file instrument.c.
Referenced by do_analyze_rel(), heap_page_prune_and_freeze(), heap_vacuum_rel(), InstrAccumParallelQuery(), InstrEndParallelQuery(), InstrStartNode(), InstrStartParallelQuery(), InstrStopNode(), pgss_planner(), pgss_ProcessUtility(), pgstat_wal_flush_cb(), pgstat_wal_have_pending_cb(), pgstat_wal_init_backend_cb(), and XLogInsertRecord().