clang-tools  14.0.0git
Public Member Functions | List of all members
clang::clangd::trace::TestTracer Class Reference

A RAII Tracer that can be used by tests. More...

#include <TestTracer.h>

Inheritance diagram for clang::clangd::trace::TestTracer:
Inheritance graph
[legend]
Collaboration diagram for clang::clangd::trace::TestTracer:
Collaboration graph
[legend]

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. More...
 
std::vector< double > takeMetric (llvm::StringRef Metric, llvm::StringRef Label="")
 Returns recorded measurements for Metric and clears them. More...
 
- 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. More...
 
virtual void endSpan ()
 
virtual void instant (llvm::StringRef Name, llvm::json::Object &&Args)
 Called for instant events. More...
 

Detailed Description

A RAII Tracer that can be used by tests.

Definition at line 28 of file TestTracer.h.

Constructor & Destructor Documentation

◆ TestTracer()

clang::clangd::trace::TestTracer::TestTracer ( )
inline

Definition at line 30 of file TestTracer.h.

Member Function Documentation

◆ record()

void clang::clangd::trace::TestTracer::record ( const Metric Metric,
double  Value,
llvm::StringRef  Label 
)
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 Label, and clang::clangd::trace::Metric::Name.

◆ takeMetric()

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 Label.


The documentation for this class was generated from the following files: