Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ public void testRQCalcGlobUsedZeroTest() throws PulsarAdminException {

@Test
public void testNeedToReportLocalUsage() {
// This field is 0 when the schedulers of `ResourceGroupService` are not started, then `needToReportLocalUsage`
// will always return true. Set it to a non-zero value to test the percentage change logic.
ResourceGroupService.maxIntervalForSuppressingReportsMSecs = 60 * 1000L; // 1 minute
Comment thread
lhotari marked this conversation as resolved.
// If the percentage change (increase or decrease) in usage is more than 5% for
// either bytes or messages, send a report.
Assert.assertFalse(rqCalc.needToReportLocalUsage(1040, 1000, 104, 100, System.currentTimeMillis()));
Expand All @@ -122,4 +125,4 @@ public void testNeedToReportLocalUsage() {
}

private ResourceQuotaCalculatorImpl rqCalc;
}
}
Loading