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
ConstructorsConstructorDescriptionProgressTrace(Maapi maapi, int tid) Creates a new instance ofProgressTraceProgressTrace(Maapi maapi, int tid, ConfPath servicePath) Creates a new instance ofProgressTrace. -
Method Summary
Modifier and TypeMethodDescriptionvoidEnd a spanvoidEnd a span with annotationvoidevent(Maapi.Verbosity verbosity, String message) Report an eventvoidevent(Maapi.Verbosity verbosity, String message, Attributes attributes) Report an eventvoidReport an eventGet the current span that is created by this API.voidsetServicePath(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- aMAAPIinstancetid- transaction ID- Throws:
ConfException
-
ProgressTrace
Creates a new instance ofProgressTrace. It is used for NSO service.- Parameters:
maapi- aMAAPIinstancetid- 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:
IOExceptionConfException
-
event
Report an event- Parameters:
verbosity- at which verbosity level the message should be reportedmessage- message to report- Throws:
IOExceptionConfException
-
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:
IOExceptionConfException
-
startSpan
Start a new span- Parameters:
message- message of the span- Returns:
- a
Spanobject that is used forendSpan(com.tailf.progress.Span) - Throws:
IOExceptionConfException
-
startSpan
Start a new span- Parameters:
verbosity- at which verbosity level the message should be reportedmessage- message of the span- Returns:
- a
Spanobject that can used inendSpan(com.tailf.progress.Span) - Throws:
IOExceptionConfException
-
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
Spanobject that can used inendSpan(com.tailf.progress.Span) - Throws:
IOExceptionConfException
-
endSpan
End a span- Parameters:
span- the span which was previously started- Throws:
IOExceptionConfException
-
endSpan
End a span with annotation- Parameters:
span- the span which was previously startedannotation- an annotation for this ending span This can benull- Throws:
IOExceptionConfException
-