#include "support/Trace.h"
#include "support/Context.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/ScopeExit.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Chrono.h"
#include "llvm/Support/FormatVariadic.h"
#include "llvm/Support/Threading.h"
#include <atomic>
#include <chrono>
#include <memory>
#include <mutex>
#include <optional>
namespace clang {
namespace clangd {
namespace trace {
namespace {
class JSONTracer : public EventTracer { … };
class CSVMetricTracer : public EventTracer { … };
Key<std::unique_ptr<JSONTracer::JSONSpan>> JSONTracer::SpanKey;
EventTracer *T = …;
}
Session::Session(EventTracer &Tracer) { … }
Session::~Session() { … }
std::unique_ptr<EventTracer> createJSONTracer(llvm::raw_ostream &OS,
bool Pretty) { … }
std::unique_ptr<EventTracer> createCSVMetricTracer(llvm::raw_ostream &OS) { … }
void log(const llvm::Twine &Message) { … }
bool enabled() { … }
static std::pair<Context, llvm::json::Object *>
makeSpanContext(llvm::Twine Name, const Metric &LatencyMetric) { … }
constexpr Metric SpanLatency("span_latency", Metric::Distribution, "span_name");
Span::Span(llvm::Twine Name) : … { … }
Span::Span(llvm::Twine Name, const Metric &LatencyMetric)
: … { … }
Span::Span(std::pair<Context, llvm::json::Object *> Pair)
: … { … }
Span::~Span() { … }
void Metric::record(double Value, llvm::StringRef Label) const { … }
Context EventTracer::beginSpan(
llvm::StringRef Name,
llvm::function_ref<void(llvm::json::Object *)> AttachDetails) { … }
}
}
}