Package io.vertigo.core.analytics
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 Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addProcess(AProcess process)
Adds an already built AProcess (via the builder) for tracking process that are not executed in a single thread environnement.HealthStatus
aggregate(List<HealthCheck> healthChecks)
Generates an aggregated status from a list of health checks.Optional<ProcessAnalyticsTracer>
getCurrentTracer()
List<HealthCheck>
getHealthChecks()
List<Metric>
getMetrics()
void
trace(String category, String name, Consumer<ProcessAnalyticsTracer> consumer)
Traces a process and collects metrics during its execution.<O> O
traceWithReturn(String category, String name, Function<ProcessAnalyticsTracer,O> function)
Traces a process that has a return value (and collects metrics during its execution).
-
-
-
Method Detail
-
trace
void trace(String category, String name, Consumer<ProcessAnalyticsTracer> consumer)
Traces a process and collects metrics during its execution. A traced process is stored by categories.- Parameters:
category
- the category of the processname
- the name of the processconsumer
- the function to execute within the tracer
-
traceWithReturn
<O> O traceWithReturn(String category, String name, Function<ProcessAnalyticsTracer,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 processname
- the name of the processfunction
- the function to execute within the tracer- Returns:
- the result of the traced function
-
getCurrentTracer
Optional<ProcessAnalyticsTracer> getCurrentTracer()
- Returns:
- the current tracer if it has been created before
-
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
-
addProcess
void addProcess(AProcess 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)- Parameters:
process
- the built process
-
-