Interface AnalyticsManager

All Superinterfaces:
Component, CoreComponent, Manager
All Known Implementing Classes:
AnalyticsManagerImpl

public interface AnalyticsManager extends Manager
Main access to all analytics functions.
Author:
pchretien, npiedeloup
  • Method Details

    • trace

      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.
      Parameters:
      category - the category of the process
      name - the name of the process
      consumer - the function to execute within the tracer
    • traceWithReturn

      <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.
      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
    • getCurrentTracer

      Optional<Tracer> getCurrentTracer()
      Returns:
      the current tracer if it has been created before
    • addSpan

      void addSpan(TraceSpan span)
      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)
      Parameters:
      span - the built process
    • getHealthChecks

      List<HealthCheck> getHealthChecks()
      Returns:
      the list of health checks
    • aggregate

      HealthStatus aggregate(List<HealthCheck> healthChecks)
      Generates an aggregated status from a list of health checks.
      Parameters:
      healthChecks - the list of halth checks.
      Returns:
      the global health status
    • getMetrics

      List<Metric> getMetrics()
      Returns:
      the list of metrics