clang-tools 20.0.0git
|
Classes | |
class | EventTracer |
A consumer of trace events and measurements. More... | |
struct | Metric |
Represents measurements of clangd events, e.g. More... | |
class | Session |
Sets up a global EventTracer that consumes events produced by Span and trace::log. More... | |
class | Span |
Records an event whose duration is the lifetime of the Span object. More... | |
class | TestTracer |
A RAII Tracer that can be used by tests. More... | |
Functions | |
std::unique_ptr< EventTracer > | createJSONTracer (llvm::raw_ostream &OS, bool Pretty=false) |
Create an instance of EventTracer that produces an output in the Trace Event format supported by Chrome's trace viewer (chrome://tracing). | |
std::unique_ptr< EventTracer > | createCSVMetricTracer (llvm::raw_ostream &OS) |
Create an instance of EventTracer that outputs metric measurements as CSV. | |
void | log (const llvm::Twine &Name) |
Records a single instant event, associated with the current thread. | |
bool | enabled () |
Returns true if there is an active tracer. | |
static std::pair< Context, llvm::json::Object * > | makeSpanContext (llvm::Twine Name, const Metric &LatencyMetric) |
constexpr Metric | SpanLatency ("span_latency", Metric::Distribution, "span_name") |
std::unique_ptr< EventTracer > clang::clangd::trace::createCSVMetricTracer | ( | llvm::raw_ostream & | OS | ) |
Create an instance of EventTracer that outputs metric measurements as CSV.
Trace spans and instant events are ignored.
Definition at line 273 of file Trace.cpp.
References OS.
Referenced by clang::clangd::clangdMain().
std::unique_ptr< EventTracer > clang::clangd::trace::createJSONTracer | ( | llvm::raw_ostream & | OS, |
bool | Pretty = false |
||
) |
Create an instance of EventTracer that produces an output in the Trace Event format supported by Chrome's trace viewer (chrome://tracing).
FIXME: Metrics are not recorded, some could become counter events.
The format is documented here: https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/preview
Definition at line 268 of file Trace.cpp.
References OS.
Referenced by clang::clangd::clangdMain(), and main().
bool clang::clangd::trace::enabled | ( | ) |
void clang::clangd::trace::log | ( | const llvm::Twine & | Message | ) |
Records a single instant event, associated with the current thread.
Definition at line 277 of file Trace.cpp.
Referenced by clang::clangd::StreamLogger::log().
|
static |
Definition at line 287 of file Trace.cpp.
References Args, clang::clangd::Context::current(), and Name.
|
constexpr |