MCPcopy
hub / github.com/netdata/netdata / runOnce

Method runOnce

src/go/plugin/framework/jobruntime/job_v2.go:363–385  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

361}
362
363func (j *JobV2) runOnce() {
364 defer j.ResetAllOnce()
365
366 j.applyPendingVnodeUpdate()
367
368 curTime := time.Now()
369 sinceLastRun := calcSinceLastRun(curTime, j.prevRun)
370 j.prevRun = curTime
371
372 prepared, ok := j.collectAndEmit(sinceLastRun)
373 if ok && !j.panicked.Load() {
374 if err := j.finishPreparedEmission(prepared); err != nil {
375 j.Warningf("finalize emission failed: %v", err)
376 ok = false
377 }
378 }
379 if ok {
380 j.retries.Store(0)
381 } else {
382 j.retries.Add(1)
383 }
384 j.buf.Reset()
385}
386
387func (j *JobV2) applyPendingVnodeUpdate() {
388 select {

Callers 2

StartMethod · 0.95
TestJobV2ScenariosFunction · 0.95

Calls 10

collectAndEmitMethod · 0.95
calcSinceLastRunFunction · 0.85
ResetAllOnceMethod · 0.80
StoreMethod · 0.80
LoadMethod · 0.65
WarningfMethod · 0.65
AddMethod · 0.65
ResetMethod · 0.65

Tested by 1

TestJobV2ScenariosFunction · 0.76