Skip to content

Commit 754d39e

Browse files
committed
refactor(resource_monitor): move stats collection to initSampler
1 parent 5c7bc28 commit 754d39e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

flow/resource_monitor.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,6 @@ func NewResourceMonitor(
8888

8989
rm.initSampler()
9090

91-
rm.stats.Store(rm.collectStats())
92-
9391
go rm.monitor()
9492

9593
return rm
@@ -109,6 +107,8 @@ func (rm *ResourceMonitor) initSampler() {
109107
default: // CPUUsageModeHeuristic
110108
rm.sampler = &goroutineHeuristicSampler{}
111109
}
110+
111+
rm.stats.Store(rm.collectStats())
112112
}
113113

114114
// GetStats returns the current resource statistics

0 commit comments

Comments
 (0)