Class CompositeTracer
java.lang.Object
org.pipservices3.components.trace.CompositeTracer
- All Implemented Interfaces:
org.pipservices3.commons.refer.IReferenceable,ITracer
public class CompositeTracer
extends Object
implements ITracer, org.pipservices3.commons.refer.IReferenceable
Aggregates all tracers from component references under a single component.
It allows to record traces and conveniently send them to multiple destinations.
### References ###
- *:tracer:*:*:1.0 (optional)
ITracercomponents to pass operation traces
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCompositeTracer(org.pipservices3.commons.refer.IReferences references) Creates a new instance of the tracer. -
Method Summary
Modifier and TypeMethodDescriptionbeginTrace(String correlationId, String component, String operation) Begings recording an operation tracevoidRecords an operation failure with its name, duration and errorvoidsetReferences(org.pipservices3.commons.refer.IReferences references) Sets references to dependent components.voidRecords an operation trace with its name and duration
-
Field Details
-
_tracers
-
-
Constructor Details
-
CompositeTracer
public CompositeTracer(org.pipservices3.commons.refer.IReferences references) throws org.pipservices3.commons.refer.ReferenceException, org.pipservices3.commons.errors.ConfigException Creates a new instance of the tracer.- Parameters:
references- references to locate the component dependencies.- Throws:
org.pipservices3.commons.refer.ReferenceExceptionorg.pipservices3.commons.errors.ConfigException
-
CompositeTracer
public CompositeTracer()
-
-
Method Details
-
setReferences
public void setReferences(org.pipservices3.commons.refer.IReferences references) Sets references to dependent components.- Specified by:
setReferencesin interfaceorg.pipservices3.commons.refer.IReferenceable- Parameters:
references- references to locate the component dependencies.
-
trace
Records an operation trace with its name and duration -
failure
public void failure(String correlationId, String component, String operation, Exception error, long duration) Records an operation failure with its name, duration and error- Specified by:
failurein interfaceITracer- Parameters:
correlationId- (optional) transaction id to trace execution through call chain.component- a name of called componentoperation- a name of the executed operation.error- an error object associated with this trace.duration- execution duration in milliseconds.
-
beginTrace
Begings recording an operation trace- Specified by:
beginTracein interfaceITracer- Parameters:
correlationId- (optional) transaction id to trace execution through call chain.component- a name of called componentoperation- a name of the executed operation.- Returns:
- a trace timing object.
-