clang-tools 20.0.0git
|
A RAII Tracer that can be used by tests. More...
#include <TestTracer.h>
Public Member Functions | |
TestTracer () | |
void | record (const Metric &Metric, double Value, llvm::StringRef Label) override |
Stores all the measurements to be returned with take later on. | |
std::vector< double > | takeMetric (llvm::StringRef Metric, llvm::StringRef Label="") |
Returns recorded measurements for Metric and clears them. | |
Public Member Functions inherited from clang::clangd::trace::EventTracer | |
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 RAII Tracer that can be used by tests.
Definition at line 28 of file TestTracer.h.
|
inline |
Definition at line 30 of file TestTracer.h.
|
overridevirtual |
Stores all the measurements to be returned with take later on.
Reimplemented from clang::clangd::trace::EventTracer.
Definition at line 17 of file TestTracer.cpp.
References clang::clangd::Label, clang::clangd::trace::Metric::Name, and clang::clangd::Value.
std::vector< double > clang::clangd::trace::TestTracer::takeMetric | ( | llvm::StringRef | Metric, |
llvm::StringRef | Label = "" |
||
) |
Returns recorded measurements for Metric
and clears them.
Definition at line 23 of file TestTracer.cpp.
References clang::clangd::Label.