[Lldb-commits] [lldb] [LLDB][Data Formatters] Calculate average and total time for summary providers within lldb (PR #102708)

Miro Bucko via lldb-commits lldb-commits at lists.llvm.org
Mon Aug 12 07:36:15 PDT 2024


================
@@ -408,3 +410,23 @@ llvm::json::Value DebuggerStats::ReportStatistics(
 
   return std::move(global_stats);
 }
+
+llvm::json::Value SummaryStatistics::ToJSON() const {
+  json::Object body {{
+      {"invocationCount", GetSummaryCount()},
+      {"totalTime", GetTotalTime()},
+      {"averageTime", GetAverageTime()}
+    }};
+  return json::Object{{GetName().AsCString(), std::move(body)}};
+}
+
+
+json::Value SummaryStatisticsCache::ToJSON() {
+  m_map_mutex.lock();
----------------
mbucko wrote:

ditto

https://github.com/llvm/llvm-project/pull/102708


More information about the lldb-commits mailing list