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

Method runOnce

src/go/plugin/framework/jobruntime/job_v1.go:442–463  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

440}
441
442func (j *Job) runOnce() {
443 defer j.ResetAllOnce()
444
445 curTime := time.Now()
446 sinceLastRun := calcSinceLastRun(curTime, j.prevRun)
447 j.prevRun = curTime
448
449 metrics := j.collect()
450
451 if j.panicked.Load() {
452 return
453 }
454
455 if j.processMetrics(metrics, curTime, sinceLastRun) {
456 j.retries.Store(0)
457 } else {
458 j.retries.Add(1)
459 }
460
461 _, _ = io.Copy(j.out, j.buf)
462 j.buf.Reset()
463}
464
465func (j *Job) collect() collectedMetrics {
466 j.panicked.Store(false)

Calls 9

collectMethod · 0.95
processMetricsMethod · 0.95
calcSinceLastRunFunction · 0.85
ResetAllOnceMethod · 0.80
StoreMethod · 0.80
LoadMethod · 0.65
AddMethod · 0.65
ResetMethod · 0.65
CopyMethod · 0.45