10#include "llvm/ADT/StringRef.h"
18 llvm::StringRef
Label) {
19 std::lock_guard<std::mutex> Lock(Mu);
24 llvm::StringRef
Label) {
25 std::lock_guard<std::mutex> Lock(Mu);
26 auto LabelsIt = Measurements.find(
Metric);
27 if (LabelsIt == Measurements.end())
29 auto &Labels = LabelsIt->getValue();
30 auto ValuesIt = Labels.find(
Label);
31 if (ValuesIt == Labels.end())
33 auto Res = std::move(ValuesIt->getValue());
34 ValuesIt->getValue().clear();
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.
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
Represents measurements of clangd events, e.g.
const llvm::StringLiteral Name
Uniquely identifies the metric.