Skip to content

Commit

Permalink
Make lastMeterRolloverStartTime volatile
Browse files Browse the repository at this point in the history
  • Loading branch information
izeye committed Dec 29, 2023
1 parent fb755f5 commit 6b8dcc7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public class OtlpMeterRegistry extends PushMeterRegistry {

// Time when the last scheduled rollOver has started. Applicable only for delta
// flavour.
private long lastMeterRolloverStartTime = -1;
private volatile long lastMeterRolloverStartTime = -1;

@Nullable
private ScheduledExecutorService meterPollingService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public abstract class StepMeterRegistry extends PushMeterRegistry {
private ScheduledExecutorService meterPollingService;

// Time when the last scheduled rollOver has started.
private long lastMeterRolloverStartTime = -1;
private volatile long lastMeterRolloverStartTime = -1;

public StepMeterRegistry(StepRegistryConfig config, Clock clock) {
super(config, clock);
Expand Down

0 comments on commit 6b8dcc7

Please sign in to comment.