Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Sam Xie <[email protected]>
  • Loading branch information
dashpole and XSAM authored Jun 22, 2024
1 parent bc4df1c commit 9f759d3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions instrumentation/runtime/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,14 @@ type goCollector struct {

func newCollector(minimumInterval time.Duration) *goCollector {
g := &goCollector{
sampleBuffer: make([]metrics.Sample, 0, len(runtimeMetrics)),
sampleMap: make(map[string]*metrics.Sample, len(runtimeMetrics)),
sampleBuffer: make([]metrics.Sample, 0, len(runtimeMetrics)),
sampleMap: make(map[string]*metrics.Sample, len(runtimeMetrics)),
minimumInterval: minimumInterval,
}
for _, runtimeMetric := range runtimeMetrics {
g.sampleBuffer = append(g.sampleBuffer, metrics.Sample{Name: runtimeMetric})
g.sampleMap[runtimeMetric] = &g.sampleBuffer[len(g.sampleBuffer)-1]
s := metrics.Sample{Name: runtimeMetric}
g.sampleBuffer = append(g.sampleBuffer, s)
g.sampleMap[runtimeMetric] = &s
}
return g
}
Expand Down

0 comments on commit 9f759d3

Please sign in to comment.