clang-tools 20.0.0git
|
Represents measurements of clangd events, e.g. More...
#include <Trace.h>
Public Types | |
enum | MetricType { Value , Counter , Distribution } |
Public Member Functions | |
constexpr | Metric (llvm::StringLiteral Name, MetricType Type, llvm::StringLiteral LabelName=llvm::StringLiteral("")) |
void | record (double Value, llvm::StringRef Label="") const |
Records a measurement for this metric to active tracer. | |
Public Attributes | |
const llvm::StringLiteral | Name |
Uniquely identifies the metric. | |
const MetricType | Type |
const llvm::StringLiteral | LabelName |
Indicates what measurement labels represent, e.g. | |
Represents measurements of clangd events, e.g.
operation latency. Those measurements are recorded per-label, defaulting to an empty one for metrics that don't care about it. This enables aggregation of measurements across labels. For example a metric tracking accesses to a cache can have labels named hit and miss.
|
inlineconstexpr |
void clang::clangd::trace::Metric::record | ( | double | Value, |
llvm::StringRef | Label = "" |
||
) | const |
Records a measurement for this metric to active tracer.
Definition at line 329 of file Trace.cpp.
References clang::clangd::Label, LabelName, and Value.
Referenced by clang::clangd::ClangdServer::applyTweak(), clang::clangd::getHover(), clang::clangd::rename(), and clang::clangd::ClangdServer::rename().
const llvm::StringLiteral clang::clangd::trace::Metric::LabelName |
const llvm::StringLiteral clang::clangd::trace::Metric::Name |
Uniquely identifies the metric.
Should use snake_case identifiers, can use dots for hierarchy if needed. e.g. method_latency, foo.bar.
Definition at line 63 of file Trace.h.
Referenced by clang::clangd::trace::TestTracer::record().
const MetricType clang::clangd::trace::Metric::Type |