Tabnine Logo
ReporterFactory
Code IndexAdd Tabnine to your IDE (free)

How to use
ReporterFactory
in
co.elastic.apm.agent.report

Best Java code snippets using co.elastic.apm.agent.report.ReporterFactory (Showing top 4 results out of 315)

origin: elastic/apm-agent-java

public ElasticApmTracer build() {
  if (configurationRegistry == null) {
    final List<ConfigurationSource> configSources = getConfigSources(agentArguments);
    configurationRegistry = getDefaultConfigurationRegistry(configSources);
  }
  if (reporter == null) {
    reporter = new ReporterFactory().createReporter(configurationRegistry, null, null);
  }
  if (lifecycleListeners == null) {
    lifecycleListeners = ServiceLoader.load(LifecycleListener.class, getClass().getClassLoader());
  }
  return new ElasticApmTracer(configurationRegistry, reporter, lifecycleListeners, activationListeners);
}
origin: elastic/apm-agent-java

public Reporter createReporter(ConfigurationRegistry configurationRegistry, @Nullable String frameworkName,
                @Nullable String frameworkVersion) {
  final ReporterConfiguration reporterConfiguration = configurationRegistry.getConfig(ReporterConfiguration.class);
  ExecutorService healthCheckExecutorService = Executors.newFixedThreadPool(1, new ThreadFactory() {
    @Override
    public Thread newThread(Runnable r) {
      final Thread thread = new Thread(r);
      thread.setName("apm-server-healthcheck");
      thread.setDaemon(true);
      return thread;
    }
  });
  healthCheckExecutorService.submit(new ApmServerHealthChecker(reporterConfiguration));
  healthCheckExecutorService.shutdown();
  final ReportingEventHandler reportingEventHandler = getReportingEventHandler(configurationRegistry, frameworkName,
    frameworkVersion, reporterConfiguration);
  return new ApmServerReporter(true, reporterConfiguration, reportingEventHandler);
}
origin: elastic/apm-agent-java

  @Test
  void testValidatingSslCertificate() throws Exception {
    when(reporterConfiguration.isVerifyServerCert()).thenReturn(true);
    final Reporter reporter = reporterFactory.createReporter(configuration, null, null);

    reporter.report(new Transaction(mock(ElasticApmTracer.class)));
    reporter.flush().get();

    assertThat(requestHandled).isFalse();
  }
}
origin: elastic/apm-agent-java

@Test
void testNotValidatingSslCertificate() throws Exception {
  when(reporterConfiguration.isVerifyServerCert()).thenReturn(false);
  final Reporter reporter = reporterFactory.createReporter(configuration, null, null);
  reporter.report(new Transaction(mock(ElasticApmTracer.class)));
  reporter.flush().get();
  assertThat(requestHandled).isTrue();
}
co.elastic.apm.agent.reportReporterFactory

Most used methods

  • createReporter
  • <init>
  • getReportingEventHandler

Popular in Java

  • Running tasks concurrently on multiple threads
  • addToBackStack (FragmentTransaction)
  • runOnUiThread (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now