clang-tools 22.0.0git
|
A consumer of trace events and measurements. More...
#include <Trace.h>
Public Member Functions | |
virtual | ~EventTracer ()=default |
virtual Context | beginSpan (llvm::StringRef Name, llvm::function_ref< void(llvm::json::Object *)> AttachDetails) |
Called when event that has a duration starts. | |
virtual void | endSpan () |
virtual void | instant (llvm::StringRef Name, llvm::json::Object &&Args) |
Called for instant events. | |
virtual void | record (const Metric &Metric, double Value, llvm::StringRef Label) |
Called whenever a metrics records a measurement. |
A consumer of trace events and measurements.
The events are produced by Spans and trace::log, the measurements are produced by Metrics::record. Implementations of this interface must be thread-safe.
|
virtualdefault |
|
virtual |
Called when event that has a duration starts.
Name
describes the event. Returns a derived context that will be destroyed when the event ends. Usually implementations will store an object in the returned context whose destructor records the end of the event. The tracer may capture event details provided in SPAN_ATTACH() calls. In this case it should call AttachDetails(), and pass in an empty Object to hold them. This Object should be owned by the context, and the data will be complete by the time the context is destroyed.
Definition at line 337 of file Trace.cpp.
References clang::clangd::Context::clone(), and clang::clangd::Context::current().
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
Called whenever a metrics records a measurement.
Reimplemented in clang::clangd::trace::TestTracer.
Definition at line 100 of file Trace.h.
References clang::clangd::Label, and clang::clangd::Value.