1 /*-------------------------------------------------------------------------
4 * definitions for run-time statistics collection
7 * Copyright (c) 2001-2008, PostgreSQL Global Development Group
11 *-------------------------------------------------------------------------
16 #include "portability/instr_time.h"
19 typedef struct Instrumentation
21 /* Info about current plan cycle: */
22 bool running
; /* TRUE if we've completed first tuple */
23 instr_time starttime
; /* Start time of current iteration of node */
24 instr_time counter
; /* Accumulated runtime for this node */
25 double firsttuple
; /* Time for first tuple of this cycle */
26 double tuplecount
; /* Tuples emitted so far this cycle */
27 /* Accumulated statistics across all completed cycles: */
28 double startup
; /* Total startup time (in seconds) */
29 double total
; /* Total total time (in seconds) */
30 double ntuples
; /* Total tuples produced */
31 double nloops
; /* # of run cycles for this node */
34 extern Instrumentation
*InstrAlloc(int n
);
35 extern void InstrStartNode(Instrumentation
*instr
);
36 extern void InstrStopNode(Instrumentation
*instr
, double nTuples
);
37 extern void InstrEndLoop(Instrumentation
*instr
);
39 #endif /* INSTRUMENT_H */