Skip to content

Commit

Permalink
Merge pull request #913 from rax-maas/move-global-throttle-check
Browse files Browse the repository at this point in the history
move global discovery throttle check
  • Loading branch information
iWebi committed Aug 17, 2022
2 parents 8133bf7 + 859a6a9 commit f83485d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ private List<IMetric> condense(List<List<IMetric>> input) throws ExecutionExcept
for (String tenant : tenants) {
newLocatorsThrottlePerTenant.get(tenant).cleanUp();
}
boolean isThrottlingGlobally = newLocatorsThrottle.size() >= maxNewLocatorsPerMinute;
List<IMetric> willIndex = new ArrayList<IMetric>();
for (List<IMetric> list : input) {
// make mockito happy.
Expand All @@ -133,7 +134,6 @@ private List<IMetric> condense(List<List<IMetric>> input) throws ExecutionExcept

for (IMetric m : list) {
boolean isAlreadySeen = LocatorCache.getInstance().isLocatorCurrentInDiscoveryLayer(m.getLocator());
boolean isThrottlingGlobally = newLocatorsThrottle.size() >= maxNewLocatorsPerMinute;
Cache<Locator, Locator> tenantThrottle = newLocatorsThrottlePerTenant.get(m.getLocator().getTenantId());
boolean isTenantThrottled = tenantThrottle.size() >= maxNewLocatorsPerMinutePerTenant;
if (!isAlreadySeen && !isThrottlingGlobally && !isTenantThrottled) {
Expand Down

0 comments on commit f83485d

Please sign in to comment.