clang-tools  14.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::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...
 
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::function_ref< void(llvm::json::Object *)>  AttachDetails 
)
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 338 of file Trace.cpp.

◆ endSpan()

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

Definition at line 94 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 97 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 100 of file Trace.h.


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