Skip to content

Commit

Permalink
[#9254] Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
emeroad committed Oct 19, 2022
1 parent bcd9389 commit 9162b26
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@ private void addUriData(AgentUriStatData agentUriStatData, UriStatInfo uriStatIn

public void executePollTimeout() {
long currentBaseTimestamp = clock.millis();
checkAndFlushOldData(currentBaseTimestamp);
boolean flush = checkAndFlushOldData(currentBaseTimestamp);
if (flush) {
LOGGER.debug("checkAndFlushOldData {}", flush);
}
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ private void storageTest(int collectInterval, int storeCount) {
Uninterruptibles.sleepUninterruptibly(sleepTime + 2, TimeUnit.MILLISECONDS);

for (int i = 0; i < storeCount; i++) {
storeRandomValue(storage);
final long timestamp = System.currentTimeMillis();
storeRandomValue(storage, timestamp);
}

Assertions.assertNull(storage.poll());
Expand All @@ -68,7 +69,6 @@ private void storageTest(int collectInterval, int storeCount) {

AgentUriStatData poll = storage.poll();
Assertions.assertNotNull(poll);

Set<Map.Entry<URIKey, EachUriStatData>> allUriStatData = poll.getAllUriStatData();
storeCount -= allUriStatData
.stream()
Expand All @@ -85,8 +85,8 @@ private void storageTest(int collectInterval, int storeCount) {
}
}

private void storeRandomValue(AsyncQueueingUriStatStorage storage) {
final long timestamp = System.currentTimeMillis();
private void storeRandomValue(AsyncQueueingUriStatStorage storage, long timestamp) {
timestamp = System.currentTimeMillis();
storage.store(URI_EXAMPLES[RANDOM.nextInt(URI_EXAMPLES.length)], RANDOM.nextBoolean(), timestamp - RANDOM.nextInt(10000), timestamp);
}

Expand Down

0 comments on commit 9162b26

Please sign in to comment.