clang-tools 22.0.0git
|
Records an event whose duration is the lifetime of the Span object. More...
#include <Trace.h>
Public Member Functions | |
Span (llvm::Twine Name) | |
Span (llvm::Twine Name, const Metric &LatencyMetric) | |
Records span's duration in milliseconds to LatencyMetric with Name as the label. | |
~Span () |
Public Attributes | |
llvm::json::Object *const | Args |
Mutable metadata, if this span is interested. |
Records an event whose duration is the lifetime of the Span object.
This lifetime is extended when the span's context is reused.
This is the main public interface for producing tracing events.
Arbitrary JSON metadata can be attached while this span is active: SPAN_ATTACH(MySpan, "Payload", SomeJSONExpr);
SomeJSONExpr is evaluated and copied only if actually needed.
clang::clangd::trace::Span::Span | ( | llvm::Twine | Name | ) |
clang::clangd::trace::Span::Span | ( | llvm::Twine | Name, |
const Metric & | LatencyMetric ) |
Records span's duration in milliseconds to LatencyMetric
with Name
as the label.
Definition at line 319 of file Trace.cpp.
References clang::clangd::trace::makeSpanContext(), and Span().
llvm::json::Object* const clang::clangd::trace::Span::Args |
Mutable metadata, if this span is interested.
Prefer to use SPAN_ATTACH rather than accessing this directly. The lifetime of Args is the whole event, even if the Span dies.
Definition at line 154 of file Trace.h.
Referenced by clang::clangd::ClangdLSPServer::MessageHandler::onCall().