Class AnalyticsManagerImpl

java.lang.Object
io.vertigo.core.impl.analytics.AnalyticsManagerImpl
All Implemented Interfaces:
AnalyticsManager, Component, CoreComponent, Manager, DefinitionProvider, SimpleDefinitionProvider

public final class AnalyticsManagerImpl extends Object implements AnalyticsManager, SimpleDefinitionProvider
Main analytics manager implementation.
Author:
pchretien
  • Constructor Details

    • AnalyticsManagerImpl

      @Inject public AnalyticsManagerImpl(List<AnalyticsConnectorPlugin> processConnectorPlugins)
      Constructor.
      Parameters:
      processConnectorPlugins - list of connectors to trace processes
  • Method Details

    • provideDefinitions

      public List<? extends Definition> provideDefinitions(DefinitionSpace definitionSpace)
      Description copied from interface: SimpleDefinitionProvider
      Provide definitions to be registered in the definitionSpace
      Specified by:
      provideDefinitions in interface SimpleDefinitionProvider
      Parameters:
      definitionSpace - the actual definitionSpace
      Returns:
      the list of new definition to register
    • trace

      public void trace(String category, String name, Consumer<Tracer> consumer)
      Traces a process and collects metrics during its execution. A traced process is stored by categories.
      Specified by:
      trace in interface AnalyticsManager
      Parameters:
      category - the category of the process
      name - the name of the process
      consumer - the function to execute within the tracer
    • traceWithReturn

      public <O> O traceWithReturn(String category, String name, Function<Tracer,O> function)
      Traces a process that has a return value (and collects metrics during its execution). A traced process is stored by categories.
      Specified by:
      traceWithReturn in interface AnalyticsManager
      Parameters:
      category - the category of the process
      name - the name of the process
      function - the function to execute within the tracer
      Returns:
      the result of the traced function
    • addSpan

      public void addSpan(TraceSpan process)
      Adds an already built AProcess (via the builder) for tracking process that are not executed in a single thread environnement. Prefer the use of method trace and traceWithReturn for commons cases (easier)
      Specified by:
      addSpan in interface AnalyticsManager
      Parameters:
      process - the built process
    • getCurrentTracer

      public Optional<Tracer> getCurrentTracer()
      Specified by:
      getCurrentTracer in interface AnalyticsManager
      Returns:
      the current tracer if it has been created before
    • sendHealthChecks

      public void sendHealthChecks()
      Daemon to retrieve healthChecks and add them to the connectors
    • getHealthChecks

      public List<HealthCheck> getHealthChecks()
      Specified by:
      getHealthChecks in interface AnalyticsManager
      Returns:
      the list of health checks
    • aggregate

      public HealthStatus aggregate(List<HealthCheck> healthChecks)
      Description copied from interface: AnalyticsManager
      Generates an aggregated status from a list of health checks.
      Specified by:
      aggregate in interface AnalyticsManager
      Parameters:
      healthChecks - the list of halth checks.
      Returns:
      the global health status
    • sendMetrics

      public void sendMetrics()
      Daemon to retrieve metrics and add them to the connectors
    • getMetrics

      public List<Metric> getMetrics()
      Specified by:
      getMetrics in interface AnalyticsManager
      Returns:
      the list of metrics