Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Keshava Munegowda <keshava.gowda@gmail.com>
  • Loading branch information
kmgowda committed Feb 6, 2022
1 parent b152a8f commit 1d329cc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions perl/src/main/java/io/perl/impl/PerformanceRecorder.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public PerformanceRecorder(PeriodicLogger periodicRecorder, Channel[] channels,

public void run(final long secondsToRun, final long totalRecords) {
final long msToRun = secondsToRun * Time.MS_PER_SEC;
final ElasticWait idleCounter = new ElasticWait(windowIntervalMS, idleNS,
final ElasticWait idleWait = new ElasticWait(windowIntervalMS, idleNS,
Math.min(windowIntervalMS, PerlConfig.DEFAULT_TIMEOUT_MS));
final long startTime = time.getCurrentTime();
boolean doWork = true;
Expand Down Expand Up @@ -71,22 +71,22 @@ public void run(final long secondsToRun, final long totalRecords) {
if (periodicRecorder.elapsedMilliSecondsWindow(ctime) > windowIntervalMS) {
periodicRecorder.stopWindow(ctime);
periodicRecorder.startWindow(ctime);
idleCounter.reset();
idleWait.reset();
}
}
}
if (doWork) {
if (notFound) {
if (idleCounter.waitAndCheck()) {
if (idleWait.waitAndCheck()) {
ctime = time.getCurrentTime();
final long diffTime = periodicRecorder.elapsedMilliSecondsWindow(ctime);
if (diffTime > windowIntervalMS) {
periodicRecorder.stopWindow(ctime);
periodicRecorder.startWindow(ctime);
idleCounter.reset();
idleCounter.setElastic(diffTime);
idleWait.reset();
idleWait.setElastic(diffTime);
} else {
idleCounter.updateElastic(diffTime);
idleWait.updateElastic(diffTime);
}
}
}
Expand Down

0 comments on commit 1d329cc

Please sign in to comment.