PostgreSQL Source Code git master
Loading...
Searching...
No Matches
instrument.c File Reference
#include "postgres.h"
#include <unistd.h>
#include "executor/executor.h"
#include "executor/instrument.h"
#include "executor/tuptable.h"
#include "nodes/execnodes.h"
#include "portability/instr_time.h"
#include "utils/guc_hooks.h"
Include dependency graph for instrument.c:

Go to the source code of this file.

Functions

static void BufferUsageAdd (BufferUsage *dst, const BufferUsage *add)
 
static void WalUsageAdd (WalUsage *dst, WalUsage *add)
 
InstrumentationInstrAlloc (int instrument_options)
 
void InstrInitOptions (Instrumentation *instr, int instrument_options)
 
void InstrStart (Instrumentation *instr)
 
static void InstrStopCommon (Instrumentation *instr, instr_time *accum_time)
 
void InstrStop (Instrumentation *instr)
 
NodeInstrumentationInstrAllocNode (int instrument_options, bool async_mode)
 
void InstrInitNode (NodeInstrumentation *instr, int instrument_options, bool async_mode)
 
void InstrStartNode (NodeInstrumentation *instr)
 
void InstrStopNode (NodeInstrumentation *instr, double nTuples)
 
TupleTableSlotExecProcNodeInstr (PlanState *node)
 
void InstrUpdateTupleCount (NodeInstrumentation *instr, double nTuples)
 
void InstrEndLoop (NodeInstrumentation *instr)
 
void InstrAggNode (NodeInstrumentation *dst, NodeInstrumentation *add)
 
TriggerInstrumentationInstrAllocTrigger (int n, int instrument_options)
 
void InstrStartTrigger (TriggerInstrumentation *tginstr)
 
void InstrStopTrigger (TriggerInstrumentation *tginstr, int64 firings)
 
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)
 
bool check_timing_clock_source (int *newval, void **extra, GucSource source)
 
void assign_timing_clock_source (int newval, void *extra)
 
const charshow_timing_clock_source (void)
 

Variables

BufferUsage pgBufferUsage
 
static BufferUsage save_pgBufferUsage
 
WalUsage pgWalUsage
 
static WalUsage save_pgWalUsage
 

Function Documentation

◆ assign_timing_clock_source()

void assign_timing_clock_source ( int  newval,
void extra 
)

Definition at line 409 of file instrument.c.

410{
411#ifdef EXEC_BACKEND
413 return;
414#else
416#endif
417
418 /*
419 * Ignore the return code since the check hook already verified TSC is
420 * usable if it's explicitly requested.
421 */
423}
#define Assert(condition)
Definition c.h:943
#define newval
bool pg_set_timing_clock_source(TimingClockSourceType source)
Definition instr_time.c:92
bool timing_initialized
Definition instr_time.c:63

References Assert, newval, pg_set_timing_clock_source(), and timing_initialized.

◆ BufferUsageAccumDiff()

void BufferUsageAccumDiff ( BufferUsage dst,
const BufferUsage add,
const BufferUsage sub 
)
inline

Definition at line 327 of file instrument.c.

330{
331 dst->shared_blks_hit += add->shared_blks_hit - sub->shared_blks_hit;
332 dst->shared_blks_read += add->shared_blks_read - sub->shared_blks_read;
333 dst->shared_blks_dirtied += add->shared_blks_dirtied - sub->shared_blks_dirtied;
334 dst->shared_blks_written += add->shared_blks_written - sub->shared_blks_written;
335 dst->local_blks_hit += add->local_blks_hit - sub->local_blks_hit;
336 dst->local_blks_read += add->local_blks_read - sub->local_blks_read;
337 dst->local_blks_dirtied += add->local_blks_dirtied - sub->local_blks_dirtied;
338 dst->local_blks_written += add->local_blks_written - sub->local_blks_written;
339 dst->temp_blks_read += add->temp_blks_read - sub->temp_blks_read;
340 dst->temp_blks_written += add->temp_blks_written - sub->temp_blks_written;
341 INSTR_TIME_ACCUM_DIFF(dst->shared_blk_read_time,
342 add->shared_blk_read_time, sub->shared_blk_read_time);
343 INSTR_TIME_ACCUM_DIFF(dst->shared_blk_write_time,
344 add->shared_blk_write_time, sub->shared_blk_write_time);
345 INSTR_TIME_ACCUM_DIFF(dst->local_blk_read_time,
346 add->local_blk_read_time, sub->local_blk_read_time);
347 INSTR_TIME_ACCUM_DIFF(dst->local_blk_write_time,
348 add->local_blk_write_time, sub->local_blk_write_time);
349 INSTR_TIME_ACCUM_DIFF(dst->temp_blk_read_time,
350 add->temp_blk_read_time, sub->temp_blk_read_time);
351 INSTR_TIME_ACCUM_DIFF(dst->temp_blk_write_time,
352 add->temp_blk_write_time, sub->temp_blk_write_time);
353}
#define INSTR_TIME_ACCUM_DIFF(x, y, z)
Definition instr_time.h:439
static int fb(int x)
instr_time local_blk_read_time
Definition instrument.h:38
int64 shared_blks_dirtied
Definition instrument.h:28
int64 local_blks_hit
Definition instrument.h:30
instr_time temp_blk_write_time
Definition instrument.h:41
instr_time shared_blk_read_time
Definition instrument.h:36
instr_time shared_blk_write_time
Definition instrument.h:37
int64 local_blks_written
Definition instrument.h:33
instr_time temp_blk_read_time
Definition instrument.h:40
instr_time local_blk_write_time
Definition instrument.h:39
int64 temp_blks_read
Definition instrument.h:34
int64 shared_blks_read
Definition instrument.h:27
int64 shared_blks_written
Definition instrument.h:29
int64 temp_blks_written
Definition instrument.h:35
int64 local_blks_read
Definition instrument.h:31
int64 local_blks_dirtied
Definition instrument.h:32
int64 shared_blks_hit
Definition instrument.h:26

References fb(), 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(), InstrStopCommon(), pgss_planner(), pgss_ProcessUtility(), serializeAnalyzeReceive(), and standard_ExplainOneQuery().

◆ BufferUsageAdd()

static void BufferUsageAdd ( BufferUsage dst,
const BufferUsage add 
)
static

Definition at line 305 of file instrument.c.

306{
307 dst->shared_blks_hit += add->shared_blks_hit;
308 dst->shared_blks_read += add->shared_blks_read;
309 dst->shared_blks_dirtied += add->shared_blks_dirtied;
310 dst->shared_blks_written += add->shared_blks_written;
311 dst->local_blks_hit += add->local_blks_hit;
312 dst->local_blks_read += add->local_blks_read;
313 dst->local_blks_dirtied += add->local_blks_dirtied;
314 dst->local_blks_written += add->local_blks_written;
315 dst->temp_blks_read += add->temp_blks_read;
316 dst->temp_blks_written += add->temp_blks_written;
317 INSTR_TIME_ADD(dst->shared_blk_read_time, add->shared_blk_read_time);
318 INSTR_TIME_ADD(dst->shared_blk_write_time, add->shared_blk_write_time);
319 INSTR_TIME_ADD(dst->local_blk_read_time, add->local_blk_read_time);
320 INSTR_TIME_ADD(dst->local_blk_write_time, add->local_blk_write_time);
321 INSTR_TIME_ADD(dst->temp_blk_read_time, add->temp_blk_read_time);
322 INSTR_TIME_ADD(dst->temp_blk_write_time, add->temp_blk_write_time);
323}
#define INSTR_TIME_ADD(x, y)
Definition instr_time.h:430

References fb(), and INSTR_TIME_ADD.

Referenced by InstrAccumParallelQuery(), and InstrAggNode().

◆ check_timing_clock_source()

bool check_timing_clock_source ( int newval,
void **  extra,
GucSource  source 
)

Definition at line 379 of file instrument.c.

380{
381 /*
382 * Do nothing if timing is not initialized. This is only expected on child
383 * processes in EXEC_BACKEND builds, as GUC hooks can be called during
384 * InitializeGUCOptions() before InitProcessGlobals() has had a chance to
385 * run pg_initialize_timing(). Instead, TSC will be initialized via
386 * restore_backend_variables.
387 */
388#ifdef EXEC_BACKEND
390 return true;
391#else
393#endif
394
395#if PG_INSTR_TSC_CLOCK
397
399 {
400 GUC_check_errdetail("TSC is not supported as timing clock source");
401 return false;
402 }
403#endif
404
405 return true;
406}
#define GUC_check_errdetail
Definition guc.h:507
int32 timing_tsc_frequency_khz
Definition instr_time.c:67

References Assert, fb(), GUC_check_errdetail, newval, timing_initialized, and timing_tsc_frequency_khz.

◆ ExecProcNodeInstr()

TupleTableSlot * ExecProcNodeInstr ( PlanState node)

Definition at line 181 of file instrument.c.

182{
184
186
187 result = node->ExecProcNodeReal(node);
188
189 InstrStopNode(node->instrument, TupIsNull(result) ? 0.0 : 1.0);
190
191 return result;
192}
uint32 result
void InstrStartNode(NodeInstrumentation *instr)
Definition instrument.c:132
void InstrStopNode(NodeInstrumentation *instr, double nTuples)
Definition instrument.c:139
ExecProcNodeMtd ExecProcNodeReal
Definition execnodes.h:1208
NodeInstrumentation * instrument
Definition execnodes.h:1211
#define TupIsNull(slot)
Definition tuptable.h:325

References PlanState::ExecProcNodeReal, InstrStartNode(), InstrStopNode(), PlanState::instrument, result, and TupIsNull.

Referenced by ExecProcNodeFirst().

◆ InstrAccumParallelQuery()

void InstrAccumParallelQuery ( BufferUsage bufusage,
WalUsage walusage 
)

Definition at line 297 of file instrument.c.

298{
299 BufferUsageAdd(&pgBufferUsage, bufusage);
300 WalUsageAdd(&pgWalUsage, walusage);
301}
static void BufferUsageAdd(BufferUsage *dst, const BufferUsage *add)
Definition instrument.c:305
static void WalUsageAdd(WalUsage *dst, WalUsage *add)
Definition instrument.c:357
WalUsage pgWalUsage
Definition instrument.c:27
BufferUsage pgBufferUsage
Definition instrument.c:25

References BufferUsageAdd(), pgBufferUsage, pgWalUsage, and WalUsageAdd().

Referenced by _brin_end_parallel(), _bt_end_parallel(), _gin_end_parallel(), ExecParallelFinish(), and parallel_vacuum_process_all_indexes().

◆ InstrAggNode()

void InstrAggNode ( NodeInstrumentation dst,
NodeInstrumentation add 
)

Definition at line 232 of file instrument.c.

233{
234 Assert(!add->running);
235
236 INSTR_TIME_ADD(dst->startup, add->startup);
237 INSTR_TIME_ADD(dst->instr.total, add->instr.total);
238 dst->ntuples += add->ntuples;
239 dst->ntuples2 += add->ntuples2;
240 dst->nloops += add->nloops;
241 dst->nfiltered1 += add->nfiltered1;
242 dst->nfiltered2 += add->nfiltered2;
243
244 if (dst->instr.need_bufusage)
245 BufferUsageAdd(&dst->instr.bufusage, &add->instr.bufusage);
246
247 if (dst->instr.need_walusage)
248 WalUsageAdd(&dst->instr.walusage, &add->instr.walusage);
249}

References Assert, BufferUsageAdd(), fb(), INSTR_TIME_ADD, and WalUsageAdd().

Referenced by ExecParallelReportInstrumentation(), and ExecParallelRetrieveInstrumentation().

◆ InstrAlloc()

Instrumentation * InstrAlloc ( int  instrument_options)

Definition at line 36 of file instrument.c.

37{
39
40 InstrInitOptions(instr, instrument_options);
41 return instr;
42}
#define palloc0_object(type)
Definition fe_memutils.h:75
void InstrInitOptions(Instrumentation *instr, int instrument_options)
Definition instrument.c:45

References InstrInitOptions(), and palloc0_object.

Referenced by standard_ExecutorStart().

◆ InstrAllocNode()

NodeInstrumentation * InstrAllocNode ( int  instrument_options,
bool  async_mode 
)

Definition at line 112 of file instrument.c.

113{
115
116 InstrInitNode(instr, instrument_options, async_mode);
117
118 return instr;
119}
#define palloc_object(type)
Definition fe_memutils.h:74
void InstrInitNode(NodeInstrumentation *instr, int instrument_options, bool async_mode)
Definition instrument.c:123

References InstrInitNode(), and palloc_object.

Referenced by ExecInitNode().

◆ InstrAllocTrigger()

TriggerInstrumentation * InstrAllocTrigger ( int  n,
int  instrument_options 
)

Definition at line 253 of file instrument.c.

254{
256 int i;
257
258 for (i = 0; i < n; i++)
259 InstrInitOptions(&tginstr[i].instr, instrument_options);
260
261 return tginstr;
262}
#define palloc0_array(type, count)
Definition fe_memutils.h:77
int i
Definition isn.c:77

References fb(), i, InstrInitOptions(), and palloc0_array.

Referenced by InitResultRelInfo().

◆ InstrEndLoop()

void InstrEndLoop ( NodeInstrumentation instr)

Definition at line 204 of file instrument.c.

205{
206 /* Skip if nothing has happened, or already shut down */
207 if (!instr->running)
208 return;
209
211 elog(ERROR, "InstrEndLoop called on running node");
212
213 /* Accumulate per-cycle statistics into totals */
214 INSTR_TIME_ADD(instr->startup, instr->firsttuple);
215 INSTR_TIME_ADD(instr->instr.total, instr->counter);
216 instr->ntuples += instr->tuplecount;
217 instr->nloops += 1;
218
219 /* Reset for next cycle (if any) */
220 instr->running = false;
224 instr->tuplecount = 0;
225}
#define ERROR
Definition elog.h:40
#define elog(elevel,...)
Definition elog.h:228
#define INSTR_TIME_IS_ZERO(t)
Definition instr_time.h:419
#define INSTR_TIME_SET_ZERO(t)
Definition instr_time.h:421
instr_time total
Definition instrument.h:88
instr_time starttime
Definition instrument.h:84
Instrumentation instr
Definition instrument.h:98
instr_time firsttuple
Definition instrument.h:104

References NodeInstrumentation::counter, elog, ERROR, NodeInstrumentation::firsttuple, NodeInstrumentation::instr, INSTR_TIME_ADD, INSTR_TIME_IS_ZERO, INSTR_TIME_SET_ZERO, NodeInstrumentation::nloops, NodeInstrumentation::ntuples, NodeInstrumentation::running, Instrumentation::starttime, NodeInstrumentation::startup, Instrumentation::total, and NodeInstrumentation::tuplecount.

Referenced by ExecParallelReportInstrumentation(), ExecReScan(), ExplainNode(), and show_modifytable_info().

◆ InstrEndParallelQuery()

void InstrEndParallelQuery ( BufferUsage bufusage,
WalUsage walusage 
)

Definition at line 287 of file instrument.c.

288{
289 memset(bufusage, 0, sizeof(BufferUsage));
291 memset(walusage, 0, sizeof(WalUsage));
293}
static BufferUsage save_pgBufferUsage
Definition instrument.c:26
static WalUsage save_pgWalUsage
Definition instrument.c:28
void WalUsageAccumDiff(WalUsage *dst, const WalUsage *add, const WalUsage *sub)
Definition instrument.c:367
void BufferUsageAccumDiff(BufferUsage *dst, const BufferUsage *add, const BufferUsage *sub)
Definition instrument.c:327

References BufferUsageAccumDiff(), fb(), pgBufferUsage, pgWalUsage, save_pgBufferUsage, save_pgWalUsage, and WalUsageAccumDiff().

Referenced by _brin_parallel_build_main(), _bt_parallel_build_main(), _gin_parallel_build_main(), parallel_vacuum_main(), and ParallelQueryMain().

◆ InstrInitNode()

void InstrInitNode ( NodeInstrumentation instr,
int  instrument_options,
bool  async_mode 
)

Definition at line 123 of file instrument.c.

124{
125 memset(instr, 0, sizeof(NodeInstrumentation));
126 InstrInitOptions(&instr->instr, instrument_options);
127 instr->async_mode = async_mode;
128}

References NodeInstrumentation::async_mode, fb(), NodeInstrumentation::instr, and InstrInitOptions().

Referenced by ExecInitParallelPlan(), and InstrAllocNode().

◆ InstrInitOptions()

void InstrInitOptions ( Instrumentation instr,
int  instrument_options 
)

Definition at line 45 of file instrument.c.

46{
47 instr->need_bufusage = (instrument_options & INSTRUMENT_BUFFERS) != 0;
48 instr->need_walusage = (instrument_options & INSTRUMENT_WAL) != 0;
49 instr->need_timer = (instrument_options & INSTRUMENT_TIMER) != 0;
50}
@ INSTRUMENT_TIMER
Definition instrument.h:63
@ INSTRUMENT_BUFFERS
Definition instrument.h:64
@ INSTRUMENT_WAL
Definition instrument.h:66

References INSTRUMENT_BUFFERS, INSTRUMENT_TIMER, INSTRUMENT_WAL, Instrumentation::need_bufusage, Instrumentation::need_timer, and Instrumentation::need_walusage.

Referenced by InstrAlloc(), InstrAllocTrigger(), and InstrInitNode().

◆ InstrStart()

void InstrStart ( Instrumentation instr)
inline

Definition at line 53 of file instrument.c.

54{
55 if (instr->need_timer)
56 {
57 if (!INSTR_TIME_IS_ZERO(instr->starttime))
58 elog(ERROR, "InstrStart called twice in a row");
59 else
61 }
62
63 /* save buffer usage totals at start, if needed */
64 if (instr->need_bufusage)
66
67 if (instr->need_walusage)
69}
#define INSTR_TIME_SET_CURRENT_FAST(t)
Definition instr_time.h:423
BufferUsage bufusage_start
Definition instrument.h:85
WalUsage walusage_start
Definition instrument.h:86

References Instrumentation::bufusage_start, elog, ERROR, INSTR_TIME_IS_ZERO, INSTR_TIME_SET_CURRENT_FAST, Instrumentation::need_bufusage, Instrumentation::need_timer, Instrumentation::need_walusage, pgBufferUsage, pgWalUsage, Instrumentation::starttime, and Instrumentation::walusage_start.

Referenced by InstrStartNode(), InstrStartTrigger(), standard_ExecutorFinish(), and standard_ExecutorRun().

◆ InstrStartNode()

void InstrStartNode ( NodeInstrumentation instr)
inline

◆ InstrStartParallelQuery()

◆ InstrStartTrigger()

void InstrStartTrigger ( TriggerInstrumentation tginstr)

Definition at line 265 of file instrument.c.

266{
267 InstrStart(&tginstr->instr);
268}

References fb(), and InstrStart().

Referenced by AfterTriggerExecute(), and ExecCallTriggerFunc().

◆ InstrStop()

void InstrStop ( Instrumentation instr)

Definition at line 103 of file instrument.c.

104{
105 InstrStopCommon(instr, &instr->total);
106}
static void InstrStopCommon(Instrumentation *instr, instr_time *accum_time)
Definition instrument.c:76

References InstrStopCommon(), and Instrumentation::total.

Referenced by InstrStopTrigger(), standard_ExecutorFinish(), and standard_ExecutorRun().

◆ InstrStopCommon()

static void InstrStopCommon ( Instrumentation instr,
instr_time accum_time 
)
inlinestatic

◆ InstrStopNode()

void InstrStopNode ( NodeInstrumentation instr,
double  nTuples 
)
inline

Definition at line 139 of file instrument.c.

140{
141 double save_tuplecount = instr->tuplecount;
142
143 /* count the returned tuples */
144 instr->tuplecount += nTuples;
145
146 /*
147 * Note that in contrast to InstrStop() the time is accumulated into
148 * NodeInstrumentation->counter, with total only getting updated in
149 * InstrEndLoop. We need the separate counter variable because we need to
150 * calculate start-up time for the first tuple in each cycle, and then
151 * accumulate it together.
152 */
153 InstrStopCommon(&instr->instr, &instr->counter);
154
155 /* Is this the first tuple of this cycle? */
156 if (!instr->running)
157 {
158 instr->running = true;
159 instr->firsttuple = instr->counter;
160 }
161 else
162 {
163 /*
164 * In async mode, if the plan node hadn't emitted any tuples before,
165 * this might be the first tuple
166 */
167 if (instr->async_mode && save_tuplecount < 1.0)
168 instr->firsttuple = instr->counter;
169 }
170}

References NodeInstrumentation::async_mode, NodeInstrumentation::counter, fb(), NodeInstrumentation::firsttuple, NodeInstrumentation::instr, InstrStopCommon(), NodeInstrumentation::running, and NodeInstrumentation::tuplecount.

Referenced by ExecAsyncConfigureWait(), ExecAsyncNotify(), ExecAsyncRequest(), ExecProcNodeInstr(), ExecShutdownNode_walker(), MultiExecBitmapAnd(), MultiExecBitmapIndexScan(), MultiExecBitmapOr(), and MultiExecHash().

◆ InstrStopTrigger()

void InstrStopTrigger ( TriggerInstrumentation tginstr,
int64  firings 
)

Definition at line 271 of file instrument.c.

272{
273 InstrStop(&tginstr->instr);
274 tginstr->firings += firings;
275}
void InstrStop(Instrumentation *instr)
Definition instrument.c:103

References fb(), and InstrStop().

Referenced by AfterTriggerExecute(), and ExecCallTriggerFunc().

◆ InstrUpdateTupleCount()

void InstrUpdateTupleCount ( NodeInstrumentation instr,
double  nTuples 
)

Definition at line 196 of file instrument.c.

197{
198 /* count the returned tuples */
199 instr->tuplecount += nTuples;
200}

References NodeInstrumentation::tuplecount.

Referenced by complete_pending_request(), and ExecMergeMatched().

◆ show_timing_clock_source()

const char * show_timing_clock_source ( void  )

Definition at line 426 of file instrument.c.

427{
428 switch (timing_clock_source)
429 {
431#if PG_INSTR_TSC_CLOCK
433 return "auto (tsc)";
434#endif
435 return "auto (system)";
437 return "system";
438#if PG_INSTR_TSC_CLOCK
440 return "tsc";
441#endif
442 }
443
444 /* unreachable */
445 return "?";
446}
int timing_clock_source
Definition instr_time.c:64
static TimingClockSourceType pg_current_timing_clock_source(void)
Definition instr_time.h:178
@ TIMING_CLOCK_SOURCE_SYSTEM
Definition instr_time.h:126
@ TIMING_CLOCK_SOURCE_AUTO
Definition instr_time.h:125

References fb(), pg_current_timing_clock_source(), timing_clock_source, TIMING_CLOCK_SOURCE_AUTO, and TIMING_CLOCK_SOURCE_SYSTEM.

◆ WalUsageAccumDiff()

void WalUsageAccumDiff ( WalUsage dst,
const WalUsage add,
const WalUsage sub 
)
inline

Definition at line 367 of file instrument.c.

368{
369 dst->wal_bytes += add->wal_bytes - sub->wal_bytes;
370 dst->wal_records += add->wal_records - sub->wal_records;
371 dst->wal_fpi += add->wal_fpi - sub->wal_fpi;
372 dst->wal_fpi_bytes += add->wal_fpi_bytes - sub->wal_fpi_bytes;
373 dst->wal_buffers_full += add->wal_buffers_full - sub->wal_buffers_full;
374}
int64 wal_buffers_full
Definition instrument.h:57
uint64 wal_bytes
Definition instrument.h:55
int64 wal_fpi
Definition instrument.h:54
uint64 wal_fpi_bytes
Definition instrument.h:56
int64 wal_records
Definition instrument.h:53

References fb(), WalUsage::wal_buffers_full, WalUsage::wal_bytes, WalUsage::wal_fpi, WalUsage::wal_fpi_bytes, and WalUsage::wal_records.

Referenced by do_analyze_rel(), heap_vacuum_rel(), InstrEndParallelQuery(), InstrStopCommon(), pgss_planner(), pgss_ProcessUtility(), pgstat_flush_backend_entry_wal(), and pgstat_wal_flush_cb().

◆ WalUsageAdd()

static void WalUsageAdd ( WalUsage dst,
WalUsage add 
)
inlinestatic

Definition at line 357 of file instrument.c.

358{
359 dst->wal_bytes += add->wal_bytes;
360 dst->wal_records += add->wal_records;
361 dst->wal_fpi += add->wal_fpi;
362 dst->wal_fpi_bytes += add->wal_fpi_bytes;
363 dst->wal_buffers_full += add->wal_buffers_full;
364}

References fb().

Referenced by InstrAccumParallelQuery(), and InstrAggNode().

Variable Documentation

◆ pgBufferUsage

◆ pgWalUsage

◆ save_pgBufferUsage

BufferUsage save_pgBufferUsage
static

Definition at line 26 of file instrument.c.

Referenced by InstrEndParallelQuery(), and InstrStartParallelQuery().

◆ save_pgWalUsage

WalUsage save_pgWalUsage
static

Definition at line 28 of file instrument.c.

Referenced by InstrEndParallelQuery(), and InstrStartParallelQuery().