MCPcopy
hub / github.com/google/seesaw / runOnce

Method runOnce

ecu/stats.go:76–92  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

74}
75
76func (e *ecuStats) runOnce() {
77 log.Info("Updating ECU statistics from Seesaw Engine...")
78 start := time.Now()
79 s, err := e.stats()
80 if err != nil {
81 log.Warningf("Couldn't update statistics: %v", err)
82 s = e.lastStats
83 }
84 s.LastUpdate = start
85 e.lastStats = s
86 e.publishersMu.RLock()
87 defer e.publishersMu.RUnlock()
88 for _, p := range e.publishers {
89 t := *s
90 p.Update(&t)
91 }
92}
93
94// run attempts to update the cached statistics from the Seesaw Engine at
95// regular intervals.

Callers 1

runMethod · 0.95

Calls 2

statsMethod · 0.95
UpdateMethod · 0.65

Tested by

no test coverage detected