test_class.declarator: DEFAULT_SOURCE = "jaeger"
test_class.modifier: private static final
test_class.original_string: private static final String DEFAULT_SOURCE = "jaeger";
test_class.type: String
test_class.var_name: DEFAULT_SOURCE
test_class.declarator: mockTraceHandler =
        MockReportableEntityHandlerFactory.getMockTraceHandler()
test_class.modifier: private
test_class.original_string: private ReportableEntityHandler<Span, String> mockTraceHandler =
        MockReportableEntityHandlerFactory.getMockTraceHandler();
test_class.type: ReportableEntityHandler<Span, String>
test_class.var_name: mockTraceHandler
test_class.declarator: mockTraceLogsHandler =
        MockReportableEntityHandlerFactory.getMockTraceSpanLogsHandler()
test_class.modifier: private
test_class.original_string: private ReportableEntityHandler<SpanLogs, String> mockTraceLogsHandler =
        MockReportableEntityHandlerFactory.getMockTraceSpanLogsHandler();
test_class.type: ReportableEntityHandler<SpanLogs, String>
test_class.var_name: mockTraceLogsHandler
test_class.declarator: startTime = System.currentTimeMillis()
test_class.modifier: private
test_class.original_string: private long startTime = System.currentTimeMillis();
test_class.type: long
test_class.var_name: startTime
test_class.file: proxy/src/test/java/com/wavefront/agent/listeners/tracing/JaegerTChannelCollectorHandlerTest.java
test_class.identifier: JaegerTChannelCollectorHandlerTest
test_case.body: @Test
    public void testJaegerDurationSampler() throws Exception {
      reset(mockTraceHandler, mockTraceLogsHandler);
  
      Span expectedSpan2 = Span.newBuilder().setCustomer("dummy").setStartMillis(startTime)
          .setDuration(9)
          .setName("HTTP GET /")
          .setSource(DEFAULT_SOURCE)
          .setSpanId("00000000-0000-0000-0000-00000023cace")
          .setTraceId("00000000-4996-02d2-0000-011f71fb04cb")
          // Note: Order of annotations list matters for this unit test.
          .setAnnotations(ImmutableList.of(
              new Annotation("ip", "10.0.0.1"),
              new Annotation("jaegerSpanId", "23cace"),
              new Annotation("jaegerTraceId", "499602d20000011f71fb04cb"),
              new Annotation("service", "frontend"),
              new Annotation("parent", "00000000-0000-0000-0000-00000012d687"),
              new Annotation("application", "Jaeger"),
              new Annotation("cluster", "none"),
              new Annotation("shard", "none"),
              new Annotation("_spanLogs", "true")))
          .build();
      mockTraceHandler.report(expectedSpan2);
      expectLastCall();
  
      mockTraceLogsHandler.report(SpanLogs.newBuilder().
          setCustomer("default").
          setSpanId("00000000-0000-0000-0000-00000023cace").
          setTraceId("00000000-4996-02d2-0000-011f71fb04cb").
          setLogs(ImmutableList.of(
              SpanLog.newBuilder().
                  setTimestamp(startTime * 1000).
                  setFields(ImmutableMap.of("event", "error", "exception", "NullPointerException")).
                  build()
          )).
          build());
      expectLastCall();
  
      replay(mockTraceHandler, mockTraceLogsHandler);
  
      JaegerTChannelCollectorHandler handler = new JaegerTChannelCollectorHandler("9876", mockTraceHandler,
          mockTraceLogsHandler, null, () -> false, () -> false, null,
          new SpanSampler(new DurationSampler(5), false), null, null);
  
      Tag ipTag = new Tag("ip", TagType.STRING);
      ipTag.setVStr("10.0.0.1");
  
      io.jaegertracing.thriftjava.Span span1 = new io.jaegertracing.thriftjava.Span(1234567890123L, 1234567890L,
          1234567L, 0L, "HTTP GET", 1, startTime * 1000, 4 * 1000);
  
      io.jaegertracing.thriftjava.Span span2 = new io.jaegertracing.thriftjava.Span(1234567890123L, 1234567890L,
          2345678L, 1234567L, "HTTP GET /", 1, startTime * 1000, 9 * 1000);
  
      Tag tag1 = new Tag("event", TagType.STRING);
      tag1.setVStr("error");
      Tag tag2 = new Tag("exception", TagType.STRING);
      tag2.setVStr("NullPointerException");
      span1.setLogs(ImmutableList.of(new Log(startTime * 1000,
          ImmutableList.of(tag1, tag2))));
      span2.setLogs(ImmutableList.of(new Log(startTime * 1000,
          ImmutableList.of(tag1, tag2))));
  
      Batch testBatch = new Batch();
      testBatch.process = new Process();
      testBatch.process.serviceName = "frontend";
      testBatch.process.setTags(ImmutableList.of(ipTag));
  
      testBatch.setSpans(ImmutableList.of(span1, span2));
  
      Collector.submitBatches_args batches = new Collector.submitBatches_args();
      batches.addToBatches(testBatch);
      ThriftRequest<Collector.submitBatches_args> request = new ThriftRequest.Builder<Collector.submitBatches_args>(
          "jaeger-collector", "Collector::submitBatches").setBody(batches).build();
      handler.handleImpl(request);
  
      verify(mockTraceHandler, mockTraceLogsHandler);
    }
test_case.class_method_signature: JaegerTChannelCollectorHandlerTest.testJaegerDurationSampler()
test_case.full_signature: @Test public void testJaegerDurationSampler()
test_case.identifier: testJaegerDurationSampler
test_case.invocations: reset build setAnnotations setTraceId setSpanId setSource setName setDuration setStartMillis setCustomer newBuilder of report expectLastCall report build setLogs setTraceId setSpanId setCustomer newBuilder of build setFields setTimestamp newBuilder of expectLastCall replay setVStr setVStr setVStr setLogs of of setLogs of of setTags of setSpans of addToBatches build setBody handleImpl verify
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testJaegerDurationSampler()
focal_class.declarator: logger =
        Logger.getLogger(JaegerTChannelCollectorHandler.class.getCanonicalName())
focal_class.modifier: protected static final
focal_class.original_string: protected static final Logger logger =
        Logger.getLogger(JaegerTChannelCollectorHandler.class.getCanonicalName());
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: JAEGER_COMPONENT = "jaeger"
focal_class.modifier: private final static
focal_class.original_string: private final static String JAEGER_COMPONENT = "jaeger";
focal_class.type: String
focal_class.var_name: JAEGER_COMPONENT
focal_class.declarator: DEFAULT_SOURCE = "jaeger"
focal_class.modifier: private final static
focal_class.original_string: private final static String DEFAULT_SOURCE = "jaeger";
focal_class.type: String
focal_class.var_name: DEFAULT_SOURCE
focal_class.declarator: spanHandler
focal_class.modifier: private final
focal_class.original_string: private final ReportableEntityHandler<Span, String> spanHandler;
focal_class.type: ReportableEntityHandler<Span, String>
focal_class.var_name: spanHandler
focal_class.declarator: spanLogsHandler
focal_class.modifier: private final
focal_class.original_string: private final ReportableEntityHandler<SpanLogs, String> spanLogsHandler;
focal_class.type: ReportableEntityHandler<SpanLogs, String>
focal_class.var_name: spanLogsHandler
focal_class.declarator: wfSender
focal_class.modifier: @Nullable
    private final
focal_class.original_string: @Nullable
    private final WavefrontSender wfSender;
focal_class.type: WavefrontSender
focal_class.var_name: wfSender
focal_class.declarator: wfInternalReporter
focal_class.modifier: @Nullable
    private final
focal_class.original_string: @Nullable
    private final WavefrontInternalReporter wfInternalReporter;
focal_class.type: WavefrontInternalReporter
focal_class.var_name: wfInternalReporter
focal_class.declarator: traceDisabled
focal_class.modifier: private final
focal_class.original_string: private final Supplier<Boolean> traceDisabled;
focal_class.type: Supplier<Boolean>
focal_class.var_name: traceDisabled
focal_class.declarator: spanLogsDisabled
focal_class.modifier: private final
focal_class.original_string: private final Supplier<Boolean> spanLogsDisabled;
focal_class.type: Supplier<Boolean>
focal_class.var_name: spanLogsDisabled
focal_class.declarator: preprocessorSupplier
focal_class.modifier: private final
focal_class.original_string: private final Supplier<ReportableEntityPreprocessor> preprocessorSupplier;
focal_class.type: Supplier<ReportableEntityPreprocessor>
focal_class.var_name: preprocessorSupplier
focal_class.declarator: sampler
focal_class.modifier: private final
focal_class.original_string: private final SpanSampler sampler;
focal_class.type: SpanSampler
focal_class.var_name: sampler
focal_class.declarator: proxyLevelApplicationName
focal_class.modifier: private final
focal_class.original_string: private final String proxyLevelApplicationName;
focal_class.type: String
focal_class.var_name: proxyLevelApplicationName
focal_class.declarator: traceDerivedCustomTagKeys
focal_class.modifier: private final
focal_class.original_string: private final Set<String> traceDerivedCustomTagKeys;
focal_class.type: Set<String>
focal_class.var_name: traceDerivedCustomTagKeys
focal_class.declarator: receivedSpansTotal
focal_class.modifier: private final
focal_class.original_string: private final Counter receivedSpansTotal;
focal_class.type: Counter
focal_class.var_name: receivedSpansTotal
focal_class.declarator: discardedTraces
focal_class.modifier: private final
focal_class.original_string: private final Counter discardedTraces;
focal_class.type: Counter
focal_class.var_name: discardedTraces
focal_class.declarator: discardedBatches
focal_class.modifier: private final
focal_class.original_string: private final Counter discardedBatches;
focal_class.type: Counter
focal_class.var_name: discardedBatches
focal_class.declarator: processedBatches
focal_class.modifier: private final
focal_class.original_string: private final Counter processedBatches;
focal_class.type: Counter
focal_class.var_name: processedBatches
focal_class.declarator: failedBatches
focal_class.modifier: private final
focal_class.original_string: private final Counter failedBatches;
focal_class.type: Counter
focal_class.var_name: failedBatches
focal_class.declarator: discardedSpansBySampler
focal_class.modifier: private final
focal_class.original_string: private final Counter discardedSpansBySampler;
focal_class.type: Counter
focal_class.var_name: discardedSpansBySampler
focal_class.declarator: discoveredHeartbeatMetrics
focal_class.modifier: private final
focal_class.original_string: private final Set<Pair<Map<String, String>, String>> discoveredHeartbeatMetrics;
focal_class.type: Set<Pair<Map<String, String>, String>>
focal_class.var_name: discoveredHeartbeatMetrics
focal_class.declarator: scheduledExecutorService
focal_class.modifier: private final
focal_class.original_string: private final ScheduledExecutorService scheduledExecutorService;
focal_class.type: ScheduledExecutorService
focal_class.var_name: scheduledExecutorService
focal_class.file: proxy/src/main/java/com/wavefront/agent/listeners/tracing/JaegerTChannelCollectorHandler.java
focal_class.identifier: JaegerTChannelCollectorHandler
focal_class.interfaces: implements Runnable, Closeable
focal_class.class_method_signature: JaegerTChannelCollectorHandler.JaegerTChannelCollectorHandler(String handle,
                                          ReportableEntityHandlerFactory handlerFactory,
                                          @Nullable WavefrontSender wfSender,
                                          Supplier<Boolean> traceDisabled,
                                          Supplier<Boolean> spanLogsDisabled,
                                          @Nullable Supplier<ReportableEntityPreprocessor> preprocessor,
                                          SpanSampler sampler,
                                          @Nullable String traceJaegerApplicationName,
                                          Set<String> traceDerivedCustomTagKeys)
focal_class.full_signature: public  JaegerTChannelCollectorHandler(String handle,
                                          ReportableEntityHandlerFactory handlerFactory,
                                          @Nullable WavefrontSender wfSender,
                                          Supplier<Boolean> traceDisabled,
                                          Supplier<Boolean> spanLogsDisabled,
                                          @Nullable Supplier<ReportableEntityPreprocessor> preprocessor,
                                          SpanSampler sampler,
                                          @Nullable String traceJaegerApplicationName,
                                          Set<String> traceDerivedCustomTagKeys)
focal_class.identifier: JaegerTChannelCollectorHandler
focal_class.modifiers: public
focal_class.parameters: (String handle,
                                          ReportableEntityHandlerFactory handlerFactory,
                                          @Nullable WavefrontSender wfSender,
                                          Supplier<Boolean> traceDisabled,
                                          Supplier<Boolean> spanLogsDisabled,
                                          @Nullable Supplier<ReportableEntityPreprocessor> preprocessor,
                                          SpanSampler sampler,
                                          @Nullable String traceJaegerApplicationName,
                                          Set<String> traceDerivedCustomTagKeys)
focal_class.signature:  JaegerTChannelCollectorHandler(String handle,
                                          ReportableEntityHandlerFactory handlerFactory,
                                          @Nullable WavefrontSender wfSender,
                                          Supplier<Boolean> traceDisabled,
                                          Supplier<Boolean> spanLogsDisabled,
                                          @Nullable Supplier<ReportableEntityPreprocessor> preprocessor,
                                          SpanSampler sampler,
                                          @Nullable String traceJaegerApplicationName,
                                          Set<String> traceDerivedCustomTagKeys)
focal_class.class_method_signature: JaegerTChannelCollectorHandler.JaegerTChannelCollectorHandler(String handle,
                                          ReportableEntityHandler<Span, String> spanHandler,
                                          ReportableEntityHandler<SpanLogs, String> spanLogsHandler,
                                          @Nullable WavefrontSender wfSender,
                                          Supplier<Boolean> traceDisabled,
                                          Supplier<Boolean> spanLogsDisabled,
                                          @Nullable Supplier<ReportableEntityPreprocessor> preprocessor,
                                          SpanSampler sampler,
                                          @Nullable String traceJaegerApplicationName,
                                          Set<String> traceDerivedCustomTagKeys)
focal_class.full_signature: public  JaegerTChannelCollectorHandler(String handle,
                                          ReportableEntityHandler<Span, String> spanHandler,
                                          ReportableEntityHandler<SpanLogs, String> spanLogsHandler,
                                          @Nullable WavefrontSender wfSender,
                                          Supplier<Boolean> traceDisabled,
                                          Supplier<Boolean> spanLogsDisabled,
                                          @Nullable Supplier<ReportableEntityPreprocessor> preprocessor,
                                          SpanSampler sampler,
                                          @Nullable String traceJaegerApplicationName,
                                          Set<String> traceDerivedCustomTagKeys)
focal_class.identifier: JaegerTChannelCollectorHandler
focal_class.modifiers: public
focal_class.parameters: (String handle,
                                          ReportableEntityHandler<Span, String> spanHandler,
                                          ReportableEntityHandler<SpanLogs, String> spanLogsHandler,
                                          @Nullable WavefrontSender wfSender,
                                          Supplier<Boolean> traceDisabled,
                                          Supplier<Boolean> spanLogsDisabled,
                                          @Nullable Supplier<ReportableEntityPreprocessor> preprocessor,
                                          SpanSampler sampler,
                                          @Nullable String traceJaegerApplicationName,
                                          Set<String> traceDerivedCustomTagKeys)
focal_class.signature:  JaegerTChannelCollectorHandler(String handle,
                                          ReportableEntityHandler<Span, String> spanHandler,
                                          ReportableEntityHandler<SpanLogs, String> spanLogsHandler,
                                          @Nullable WavefrontSender wfSender,
                                          Supplier<Boolean> traceDisabled,
                                          Supplier<Boolean> spanLogsDisabled,
                                          @Nullable Supplier<ReportableEntityPreprocessor> preprocessor,
                                          SpanSampler sampler,
                                          @Nullable String traceJaegerApplicationName,
                                          Set<String> traceDerivedCustomTagKeys)
focal_class.class_method_signature: JaegerTChannelCollectorHandler.handleImpl(
        ThriftRequest<Collector.submitBatches_args> request)
focal_class.full_signature: @Override public ThriftResponse<Collector.submitBatches_result> handleImpl(
        ThriftRequest<Collector.submitBatches_args> request)
focal_class.identifier: handleImpl
focal_class.modifiers: @Override public
focal_class.parameters: (
        ThriftRequest<Collector.submitBatches_args> request)
focal_class.return: ThriftResponse<Collector.submitBatches_result>
focal_class.signature: ThriftResponse<Collector.submitBatches_result> handleImpl(
        ThriftRequest<Collector.submitBatches_args> request)
focal_class.class_method_signature: JaegerTChannelCollectorHandler.run()
focal_class.full_signature: @Override public void run()
focal_class.identifier: run
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void run()
focal_class.class_method_signature: JaegerTChannelCollectorHandler.close()
focal_class.full_signature: @Override public void close()
focal_class.identifier: close
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void close()
focal_class.superclass: extends ThriftRequestHandler<Collector.submitBatches_args,
      Collector.submitBatches_result>
focal_method.body: @Override
    public ThriftResponse<Collector.submitBatches_result> handleImpl(
        ThriftRequest<Collector.submitBatches_args> request) {
      for (Batch batch : request.getBody(Collector.submitBatches_args.class).getBatches()) {
        try {
          processBatch(batch, null, DEFAULT_SOURCE, proxyLevelApplicationName, spanHandler,
              spanLogsHandler, wfInternalReporter, traceDisabled, spanLogsDisabled,
              preprocessorSupplier, sampler, traceDerivedCustomTagKeys, discardedTraces,
              discardedBatches, discardedSpansBySampler, discoveredHeartbeatMetrics,
              receivedSpansTotal);
          processedBatches.inc();
        } catch (Exception e) {
          failedBatches.inc();
          logger.log(Level.WARNING, "Jaeger Thrift batch processing failed",
              Throwables.getRootCause(e));
        }
      }
      return new ThriftResponse.Builder<Collector.submitBatches_result>(request)
          .setBody(new Collector.submitBatches_result())
          .build();
    }
focal_method.class_method_signature: JaegerTChannelCollectorHandler.handleImpl(
        ThriftRequest<Collector.submitBatches_args> request)
focal_method.full_signature: @Override public ThriftResponse<Collector.submitBatches_result> handleImpl(
        ThriftRequest<Collector.submitBatches_args> request)
focal_method.identifier: handleImpl
focal_method.invocations: getBatches getBody processBatch inc inc log getRootCause build setBody
focal_method.modifiers: @Override public
focal_method.parameters: (
        ThriftRequest<Collector.submitBatches_args> request)
focal_method.return: ThriftResponse<Collector.submitBatches_result>
focal_method.signature: ThriftResponse<Collector.submitBatches_result> handleImpl(
        ThriftRequest<Collector.submitBatches_args> request)