MCPcopy Create free account
hub / github.com/apache/cloudberry / InstrEndLoop

Function InstrEndLoop

src/backend/executor/instrument.c:185–214  ·  view source on GitHub ↗

Finish a run cycle for a plan node */

Source from the content-addressed store, hash-verified

183
184/* Finish a run cycle for a plan node */
185void
186InstrEndLoop(Instrumentation *instr)
187{
188 double totaltime;
189
190 /* Skip if nothing has happened, or already shut down */
191 if (!instr->running)
192 return;
193
194 if (!INSTR_TIME_IS_ZERO(instr->starttime))
195 elog(ERROR, "InstrEndLoop called on running node");
196
197 /* Accumulate per-cycle statistics into totals */
198 totaltime = INSTR_TIME_GET_DOUBLE(instr->counter);
199
200 /* CDB: Report startup time from only the first cycle. */
201 if (instr->nloops == 0)
202 instr->startup = instr->firsttuple;
203
204 instr->total += totaltime;
205 instr->ntuples += instr->tuplecount;
206 instr->nloops += 1;
207
208 /* Reset for next cycle (if any) */
209 instr->running = false;
210 INSTR_TIME_SET_ZERO(instr->starttime);
211 INSTR_TIME_SET_ZERO(instr->counter);
212 instr->firsttuple = 0;
213 instr->tuplecount = 0;
214}
215
216/* aggregate instrumentation information */
217void

Callers 8

pgss_ExecutorEndFunction · 0.85
explain_ExecutorEndFunction · 0.85
report_triggersFunction · 0.85
ExplainNodeFunction · 0.85
show_modifytable_infoFunction · 0.85
ExecReScanFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected