Skip to content

Commit

Permalink
Synchronize access to time series.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 369426995
  • Loading branch information
meisterT authored and copybara-github committed Apr 20, 2021
1 parent c9c9bd3 commit f92e007
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -725,9 +725,11 @@ private void completeTask(TaskData data) {

if (shouldRecordTask) {
if (actionCountTimeSeries != null && countAction(data.type, data)) {
actionCountTimeSeries.addRange(
Duration.ofNanos(data.startTimeNanos).toMillis(),
Duration.ofNanos(endTime).toMillis());
synchronized (this) {
actionCountTimeSeries.addRange(
Duration.ofNanos(data.startTimeNanos).toMillis(),
Duration.ofNanos(endTime).toMillis());
}
}
SlowestTaskAggregator aggregator = slowestTasks[data.type.ordinal()];
if (aggregator != null) {
Expand Down

0 comments on commit f92e007

Please sign in to comment.