================ @@ -73,9 +104,46 @@ class TelemetryManager : public llvm::telemetry::Manager { private: std::unique_ptr<llvm::telemetry::Config> m_config; + // Each instance of a TelemetryManager is assigned a unique ID. + const std::string m_id; + static std::unique_ptr<TelemetryManager> g_instance; }; +/// Helper RAII class for collecting telemetry. +class ScopeTelemetryCollector { +public: + ScopeTelemetryCollector() { + if (TelemetryEnabled()) + m_start = std::chrono::steady_clock::now(); ---------------- JDevlieghere wrote:
Any downside to doing this unconditionally? It's not like `m_start` is an optional, so unless `steady_clock::now()` is super expensive, seems easier to always set the correct start time in the ctor. https://github.com/llvm/llvm-project/pull/127696 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits