@Test public void testRateNotExceededThenExceededSpan() throws Exception { tracingPlugin.getDefaultRateLimitSpansPerMinuteOption().update(60d, SimpleSource.NAME); interceptor.interceptReport(context); assertTrue(context.isReport()); interceptor.interceptReport(context); assertFalse(context.isReport()); }
@Override public void interceptReport(PreExecutionInterceptorContext context) { if (rateLimiter == null) { return; } if (isRateExceeded(rateLimiter) && isRoot(context.getSpanContext().getSpanWrapper())) { context.shouldNotReport(getClass()); } }
RateLimitingPreExecutionInterceptor extends PreExecutionSpanInterceptor { @Override public void interceptReport(PreExecutionInterceptorContext context) { if (rateLimiter == null) { return; } if (isRateExceeded(rateLimiter) && isRoot(context.getSpanContext().getSpanWrapper())) { context.shouldNotReport(getClass()); } } }
RateLimitingPreExecutionInterceptor extends PreExecutionSpanInterceptor { @Override public void interceptReport(PreExecutionInterceptorContext context) { if (rateLimiter == null) { return; } if (isRateExceeded(rateLimiter) && isRoot(context.getSpanContext().getSpanWrapper())) { context.shouldNotReport(getClass()); } }  }
RateLimitingPreExecutionInterceptor extends PreExecutionSpanInterceptor { @Override public void interceptReport(PreExecutionInterceptorContext context) { if (rateLimiter == null) { return; } if (isRateExceeded(rateLimiter) && isRoot(context.getSpanContext().getSpanWrapper())) { context.shouldNotReport(getClass()); } }  @Override void init(ConfigurationRegistry configuration); static RateLimiter getRateLimiter(double creditsPerMinute); @Override void interceptReport(PreExecutionInterceptorContext context); static boolean isRateExceeded(RateLimiter rateLimiter); }
RateLimitingPreExecutionInterceptor extends PreExecutionSpanInterceptor { @Override public void interceptReport(PreExecutionInterceptorContext context) { if (rateLimiter == null) { return; } if (isRateExceeded(rateLimiter) && isRoot(context.getSpanContext().getSpanWrapper())) { context.shouldNotReport(getClass()); } }  @Override void init(ConfigurationRegistry configuration); static RateLimiter getRateLimiter(double creditsPerMinute); @Override void interceptReport(PreExecutionInterceptorContext context); static boolean isRateExceeded(RateLimiter rateLimiter);  }