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

A consumer of trace events and measurements. More...

#include <Trace.h>

Inheritance diagram for clang::clangd::trace::EventTracer:
Inheritance graph
[legend]

Public Member Functions

virtual ~EventTracer ()=default
 
virtual Context beginSpan (llvm::StringRef Name, llvm::json::Object *Args)
 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...
 
virtual void record (const Metric &Metric, double Value, llvm::StringRef Label)
 Called whenever a metrics records a measurement. More...
 

Detailed Description

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.

Definition at line 74 of file Trace.h.

Constructor & Destructor Documentation

◆ ~EventTracer()

virtual clang::clangd::trace::EventTracer::~EventTracer ( )
virtualdefault

Member Function Documentation

◆ beginSpan()

Context clang::clangd::trace::EventTracer::beginSpan ( llvm::StringRef  Name,
llvm::json::Object *  Args 
)
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 args are *Args, only complete when the event ends.

Definition at line 326 of file Trace.cpp.

◆ endSpan()

virtual void clang::clangd::trace::EventTracer::endSpan ( )
inlinevirtual

Definition at line 89 of file Trace.h.

◆ instant()

virtual void clang::clangd::trace::EventTracer::instant ( llvm::StringRef  Name,
llvm::json::Object &&  Args 
)
inlinevirtual

Called for instant events.

Definition at line 92 of file Trace.h.

◆ record()

virtual void clang::clangd::trace::EventTracer::record ( const Metric Metric,
double  Value,
llvm::StringRef  Label 
)
inlinevirtual

Called whenever a metrics records a measurement.

Reimplemented in clang::clangd::trace::TestTracer.

Definition at line 95 of file Trace.h.


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