Package com.tailf.progress
Class ProgressTrace
Object
com.tailf.progress.ProgressTrace
- Direct Known Subclasses:
ProgressTraceNed
ProgressTrace
class interacts with ConfD/NCS's
progress trace framework over underlying
MAAPI
. See the Progress Trace chapter
in the NSO Development Guide or in the ConfD User Guide for more
information. The class is implemented based on the concept of
spans. For example:
ProgressTrace progress = new ProgressTrace(maapi, tid); Attributes attributes = new Attributes(); attributes.set("name", "value"); Span span1 = progress.startSpan(Maapi.Verbosity.VERY_VERBOSE, "span1", attributes, null); Span span2 = progress.startSpan("span2"); progress.endSpan(span2); progress.endSpan(span1);
-
Constructor Summary
ConstructorDescriptionProgressTrace
(Maapi maapi, int tid) Creates a new instance ofProgressTrace
ProgressTrace
(Maapi maapi, int tid, ConfPath servicePath) Creates a new instance ofProgressTrace
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
End a spanvoid
End a span with annotationvoid
event
(Maapi.Verbosity verbosity, String message) Report an eventvoid
event
(Maapi.Verbosity verbosity, String message, Attributes attributes) Report an eventvoid
Report an eventGet the current span that is created by this API.void
setServicePath
(ConfPath servicePath) Set NSO's service pathstartSpan
(Maapi.Verbosity verbosity, String message) Start a new spanstartSpan
(Maapi.Verbosity verbosity, String message, Attributes attributes, Span[] links) Start a new spanStart a new span
-
Constructor Details
-
ProgressTrace
Creates a new instance ofProgressTrace
- Parameters:
maapi
- aMAAPI
instancetid
- transaction ID- Throws:
ConfException
-
ProgressTrace
Creates a new instance ofProgressTrace
. It is used for NSO service.- Parameters:
maapi
- aMAAPI
instancetid
- transaction IDservicePath
- path of an NSO service instance
-
-
Method Details
-
getCurrentSpan
Get the current span that is created by this API. The current span is updated to a new span or previous span depending on when astartSpan(java.lang.String)
or aendSpan(com.tailf.progress.Span)
is called. -
setServicePath
Set NSO's service path- Parameters:
servicePath
- the service path
-
event
Report an event- Parameters:
message
- message to report- Throws:
IOException
ConfException
-
event
Report an event- Parameters:
verbosity
- at which verbosity level the message should be reportedmessage
- message to report- Throws:
IOException
ConfException
-
event
public void event(Maapi.Verbosity verbosity, String message, Attributes attributes) throws IOException, ConfException Report an event- Parameters:
verbosity
- at which verbosity level the message should be reportedmessage
- message to reportattributes
- attributes of the events. This can benull
.- Throws:
IOException
ConfException
-
startSpan
Start a new span- Parameters:
message
- message of the span- Returns:
- a
Span
object that is used forendSpan(com.tailf.progress.Span)
- Throws:
IOException
ConfException
-
startSpan
Start a new span- Parameters:
verbosity
- at which verbosity level the message should be reportedmessage
- message of the span- Returns:
- a
Span
object that can used inendSpan(com.tailf.progress.Span)
- Throws:
IOException
ConfException
-
startSpan
public Span startSpan(Maapi.Verbosity verbosity, String message, Attributes attributes, Span[] links) throws IOException, ConfException Start a new span- Parameters:
verbosity
- at which verbosity level the message should be reportedmessage
- message of the spanattributes
- attributes of the span This can benull
.links
- list of linked spans This can benull
.- Returns:
- a
Span
object that can used inendSpan(com.tailf.progress.Span)
- Throws:
IOException
ConfException
-
endSpan
End a span- Parameters:
span
- the span which was previously started- Throws:
IOException
ConfException
-
endSpan
End a span with annotation- Parameters:
span
- the span which was previously startedannotation
- an annotation for this ending span This can benull
- Throws:
IOException
ConfException
-