test_class.declarator: interceptor
test_class.modifier: private
test_class.original_string: private RateLimitingPreExecutionInterceptor interceptor;
test_class.type: RateLimitingPreExecutionInterceptor
test_class.var_name: interceptor
test_class.declarator: tracingPlugin
test_class.modifier: private
test_class.original_string: private TracingPlugin tracingPlugin;
test_class.type: TracingPlugin
test_class.var_name: tracingPlugin
test_class.declarator: context
test_class.modifier: private
test_class.original_string: private PreExecutionInterceptorContext context;
test_class.type: PreExecutionInterceptorContext
test_class.var_name: context
test_class.declarator: spanContext
test_class.modifier: private
test_class.original_string: private SpanContextInformation spanContext;
test_class.type: SpanContextInformation
test_class.var_name: spanContext
test_class.declarator: configuration
test_class.modifier: private
test_class.original_string: private ConfigurationRegistry configuration;
test_class.type: ConfigurationRegistry
test_class.var_name: configuration
test_class.file: stagemonitor-tracing/src/test/java/org/stagemonitor/tracing/sampling/RateLimitingPreExecutionInterceptorTest.java
test_class.identifier: RateLimitingPreExecutionInterceptorTest
test_case.body: @Test
  	public void testRateNotExceededThenExceededSpan() throws Exception {
  		tracingPlugin.getDefaultRateLimitSpansPerMinuteOption().update(60d, SimpleSource.NAME);
  
  		interceptor.interceptReport(context);
  		assertTrue(context.isReport());
  
  		interceptor.interceptReport(context);
  		assertFalse(context.isReport());
  	}
test_case.class_method_signature: RateLimitingPreExecutionInterceptorTest.testRateNotExceededThenExceededSpan()
test_case.full_signature: @Test public void testRateNotExceededThenExceededSpan()
test_case.identifier: testRateNotExceededThenExceededSpan
test_case.invocations: update getDefaultRateLimitSpansPerMinuteOption interceptReport assertTrue isReport interceptReport assertFalse isReport
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testRateNotExceededThenExceededSpan()
focal_class.declarator: rateLimiter
focal_class.modifier: private
focal_class.original_string: private RateLimiter rateLimiter;
focal_class.type: RateLimiter
focal_class.var_name: rateLimiter
focal_class.declarator: tracingPlugin
focal_class.modifier: private
focal_class.original_string: private TracingPlugin tracingPlugin;
focal_class.type: TracingPlugin
focal_class.var_name: tracingPlugin
focal_class.file: stagemonitor-tracing/src/main/java/org/stagemonitor/tracing/sampling/RateLimitingPreExecutionInterceptor.java
focal_class.identifier: RateLimitingPreExecutionInterceptor
focal_class.class_method_signature: RateLimitingPreExecutionInterceptor.init(ConfigurationRegistry configuration)
focal_class.full_signature: @Override public void init(ConfigurationRegistry configuration)
focal_class.identifier: init
focal_class.modifiers: @Override public
focal_class.parameters: (ConfigurationRegistry configuration)
focal_class.return: void
focal_class.signature: void init(ConfigurationRegistry configuration)
focal_class.class_method_signature: RateLimitingPreExecutionInterceptor.getRateLimiter(double creditsPerMinute)
focal_class.full_signature: public static RateLimiter getRateLimiter(double creditsPerMinute)
focal_class.identifier: getRateLimiter
focal_class.modifiers: public static
focal_class.parameters: (double creditsPerMinute)
focal_class.return: RateLimiter
focal_class.signature: RateLimiter getRateLimiter(double creditsPerMinute)
focal_class.class_method_signature: RateLimitingPreExecutionInterceptor.interceptReport(PreExecutionInterceptorContext context)
focal_class.full_signature: @Override public void interceptReport(PreExecutionInterceptorContext context)
focal_class.identifier: interceptReport
focal_class.modifiers: @Override public
focal_class.parameters: (PreExecutionInterceptorContext context)
focal_class.return: void
focal_class.signature: void interceptReport(PreExecutionInterceptorContext context)
focal_class.class_method_signature: RateLimitingPreExecutionInterceptor.isRoot(SpanWrapper span)
focal_class.full_signature: protected boolean isRoot(SpanWrapper span)
focal_class.identifier: isRoot
focal_class.modifiers: protected
focal_class.parameters: (SpanWrapper span)
focal_class.return: boolean
focal_class.signature: boolean isRoot(SpanWrapper span)
focal_class.class_method_signature: RateLimitingPreExecutionInterceptor.isRateExceeded(RateLimiter rateLimiter)
focal_class.full_signature: public static boolean isRateExceeded(RateLimiter rateLimiter)
focal_class.identifier: isRateExceeded
focal_class.modifiers: public static
focal_class.parameters: (RateLimiter rateLimiter)
focal_class.return: boolean
focal_class.signature: boolean isRateExceeded(RateLimiter rateLimiter)
focal_class.superclass: extends PreExecutionSpanInterceptor
focal_method.body: @Override
  	public void interceptReport(PreExecutionInterceptorContext context) {
  		if (rateLimiter == null) {
  			return;
  		}
  		// the rate limit is per span but we either sample a trace as a whole or don't sample it
  		// even though we don't make sampling decisions for non root spans
  		// we need to tell the rate limiter that there is another span being sampled
  		// so that the cost is incorporated
  		if (isRateExceeded(rateLimiter) && isRoot(context.getSpanContext().getSpanWrapper())) {
  			context.shouldNotReport(getClass());
  		}
  	}
focal_method.class_method_signature: RateLimitingPreExecutionInterceptor.interceptReport(PreExecutionInterceptorContext context)
focal_method.full_signature: @Override public void interceptReport(PreExecutionInterceptorContext context)
focal_method.identifier: interceptReport
focal_method.invocations: isRateExceeded isRoot getSpanWrapper getSpanContext shouldNotReport getClass
focal_method.modifiers: @Override public
focal_method.parameters: (PreExecutionInterceptorContext context)
focal_method.return: void
focal_method.signature: void interceptReport(PreExecutionInterceptorContext context)