Package io.vertigo.core.impl.analytics
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 Summary
ConstructorsConstructorDescriptionAnalyticsManagerImpl(List<AnalyticsConnectorPlugin> processConnectorPlugins) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds an already built AProcess (via the builder) for tracking process that are not executed in a single thread environnement.aggregate(List<HealthCheck> healthChecks) Generates an aggregated status from a list of health checks.List<? extends Definition> provideDefinitions(DefinitionSpace definitionSpace) Provide definitions to be registered in the definitionSpacevoidDaemon to retrieve healthChecks and add them to the connectorsvoidDaemon to retrieve metrics and add them to the connectorsvoidTraces a process and collects metrics during its execution.<O> OtraceWithReturn(String category, String name, Function<Tracer, O> function) Traces a process that has a return value (and collects metrics during its execution).Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.vertigo.core.node.definition.DefinitionProvider
addDefinitionResourceConfigMethods inherited from interface io.vertigo.core.node.definition.SimpleDefinitionProvider
get
-
Constructor Details
-
AnalyticsManagerImpl
Constructor.- Parameters:
processConnectorPlugins- list of connectors to trace processes
-
-
Method Details
-
provideDefinitions
Description copied from interface:SimpleDefinitionProviderProvide definitions to be registered in the definitionSpace- Specified by:
provideDefinitionsin interfaceSimpleDefinitionProvider- Parameters:
definitionSpace- the actual definitionSpace- Returns:
- the list of new definition to register
-
trace
Traces a process and collects metrics during its execution. A traced process is stored by categories.- Specified by:
tracein interfaceAnalyticsManager- Parameters:
category- the category of the processname- the name of the processconsumer- the function to execute within the tracer
-
traceWithReturn
Traces a process that has a return value (and collects metrics during its execution). A traced process is stored by categories.- Specified by:
traceWithReturnin interfaceAnalyticsManager- 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
-
addSpan
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:
addSpanin interfaceAnalyticsManager- Parameters:
process- the built process
-
getCurrentTracer
- Specified by:
getCurrentTracerin interfaceAnalyticsManager- 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
- Specified by:
getHealthChecksin interfaceAnalyticsManager- Returns:
- the list of health checks
-
aggregate
Description copied from interface:AnalyticsManagerGenerates an aggregated status from a list of health checks.- Specified by:
aggregatein interfaceAnalyticsManager- 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
- Specified by:
getMetricsin interfaceAnalyticsManager- Returns:
- the list of metrics
-