Skip to content
This repository was archived by the owner on Jul 31, 2023. It is now read-only.

Commit cd9ae5c

Browse files
authored
Remove call to time.Now() on worker thread when handling record reqs (#1210)
Time is already recorded on the client side and stored in the currently unused recordReq.t field. Avoiding these repeated calls to time.Now while the worker is blocked can significantly reduce worker contention.
1 parent 46dfec7 commit cd9ae5c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

stats/view/worker_commands.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ func (cmd *recordReq) handleCommand(w *worker) {
163163
}
164164
ref := w.getMeasureRef(m.Measure().Name())
165165
for v := range ref.views {
166-
v.addSample(cmd.tm, m.Value(), cmd.attachments, time.Now())
166+
v.addSample(cmd.tm, m.Value(), cmd.attachments, cmd.t)
167167
}
168168
}
169169
}

0 commit comments

Comments
 (0)