CompositeTracer class

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) ITracer components to pass operation traces

See ITracer

Example

class MyComponent implements IReferenceable { var _tracer = CompositeTracer();

void setReferences(IReferences references) {
    _tracer.setReferences(references);
    ...
}

void myMethod(String correlatonId) {
    var timing = _tracer.beginTrace(correlationId, "mycomponent", "mymethod");
    try {
        ...
        timing.endTrace();
    } catch (err) {
        timing.endFailure(err);
    }
}

}

Implemented types

Constructors

CompositeTracer([IReferences? references])
Creates a new instance of the tracer.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

beginTrace(String? correlationId, String component, String operation) TraceTiming
Begings recording an operation trace
override
failure(String? correlationId, String component, String operation, Exception error, int duration) → void
Records an operation failure with its name, duration and error
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setReferences(IReferences references) → void
Sets references to dependent components.
toString() String
A string representation of this object.
inherited
trace(String? correlationId, String component, String operation, int duration) → void
Records an operation trace with its name and duration
override

Operators

operator ==(Object other) bool
The equality operator.
inherited