test_class.file: proxy/src/test/java/com/wavefront/agent/sampler/SpanSamplerTest.java
test_class.identifier: SpanSamplerTest
test_case.body: @Test
    public void testSample() {
      long startTime = System.currentTimeMillis();
      String traceId = UUID.randomUUID().toString();
      Span spanToAllow = Span.newBuilder().
          setCustomer("dummy").
          setStartMillis(startTime).
          setDuration(6).
          setName("testSpanName").
          setSource("testsource").
          setSpanId("testspanid").
          setTraceId(traceId).
          build();
      Span spanToDiscard = Span.newBuilder().
          setCustomer("dummy").
          setStartMillis(startTime).
          setDuration(4).
          setName("testSpanName").
          setSource("testsource").
          setSpanId("testspanid").
          setTraceId(traceId).
          build();
      SpanSampler sampler = new SpanSampler(new DurationSampler(5), true);
      assertTrue(sampler.sample(spanToAllow));
      assertFalse(sampler.sample(spanToDiscard));
  
      Counter discarded = Metrics.newCounter(new MetricName("SpanSamplerTest", "testSample",
          "discarded"));
      assertTrue(sampler.sample(spanToAllow, discarded));
      assertEquals(0, discarded.count());
      assertFalse(sampler.sample(spanToDiscard, discarded));
      assertEquals(1, discarded.count());
    }
test_case.class_method_signature: SpanSamplerTest.testSample()
test_case.full_signature: @Test public void testSample()
test_case.identifier: testSample
test_case.invocations: currentTimeMillis toString randomUUID build setTraceId setSpanId setSource setName setDuration setStartMillis setCustomer newBuilder build setTraceId setSpanId setSource setName setDuration setStartMillis setCustomer newBuilder assertTrue sample assertFalse sample newCounter assertTrue sample assertEquals count assertFalse sample assertEquals count
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testSample()
focal_class.declarator: delegate
focal_class.modifier: private final
focal_class.original_string: private final Sampler delegate;
focal_class.type: Sampler
focal_class.var_name: delegate
focal_class.declarator: alwaysSampleErrors
focal_class.modifier: private final
focal_class.original_string: private final boolean alwaysSampleErrors;
focal_class.type: boolean
focal_class.var_name: alwaysSampleErrors
focal_class.file: proxy/src/main/java/com/wavefront/agent/sampler/SpanSampler.java
focal_class.identifier: SpanSampler
focal_class.class_method_signature: SpanSampler.SpanSampler(Sampler delegate, boolean alwaysSampleErrors)
focal_class.full_signature: public  SpanSampler(Sampler delegate, boolean alwaysSampleErrors)
focal_class.identifier: SpanSampler
focal_class.modifiers: public
focal_class.parameters: (Sampler delegate, boolean alwaysSampleErrors)
focal_class.signature:  SpanSampler(Sampler delegate, boolean alwaysSampleErrors)
focal_class.class_method_signature: SpanSampler.sample(Span span)
focal_class.full_signature: public boolean sample(Span span)
focal_class.identifier: sample
focal_class.modifiers: public
focal_class.parameters: (Span span)
focal_class.return: boolean
focal_class.signature: boolean sample(Span span)
focal_class.class_method_signature: SpanSampler.sample(Span span, @Nullable Counter discarded)
focal_class.full_signature: public boolean sample(Span span, @Nullable Counter discarded)
focal_class.identifier: sample
focal_class.modifiers: public
focal_class.parameters: (Span span, @Nullable Counter discarded)
focal_class.return: boolean
focal_class.signature: boolean sample(Span span, @Nullable Counter discarded)
focal_class.class_method_signature: SpanSampler.isForceSampled(Span span)
focal_class.full_signature: private boolean isForceSampled(Span span)
focal_class.identifier: isForceSampled
focal_class.modifiers: private
focal_class.parameters: (Span span)
focal_class.return: boolean
focal_class.signature: boolean isForceSampled(Span span)
focal_method.body: public boolean sample(Span span) {
      return sample(span, null);
    }
focal_method.class_method_signature: SpanSampler.sample(Span span)
focal_method.full_signature: public boolean sample(Span span)
focal_method.identifier: sample
focal_method.invocations: sample
focal_method.modifiers: public
focal_method.parameters: (Span span)
focal_method.return: boolean
focal_method.signature: boolean sample(Span span)