[PATCH] D88413: [clangd] Add a metric for tracking memory usage

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 9 03:52:27 PDT 2020


sammccall added inline comments.


================
Comment at: clang-tools-extra/clangd/support/MemoryTree.h:68
 
+  /// Records total memory usage of each node under "memory_usage" metric.
+  /// Labels are edges on the path joined with ".", starting with \p RootName.
----------------
can we make this a non-member function and take the metric to write into as a parameter?

Putting this here for reuse seems OK to me but it's not an essential part of MemoryTree itself.
In particular I'd like to avoid baking magic metrics into support/.

(I know we have one already for fallback latency recording, but that seems much costlier to avoid as there are many callsites. Here we expect... 2?)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88413/new/

https://reviews.llvm.org/D88413



More information about the cfe-commits mailing list