[PATCH] D94393: [clangd] Add metrics for go-to-implementation.

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 11 01:34:03 PST 2021


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG1677c86124e5: [clangd] Add metrics for go-to-implementation. (authored by hokein).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D94393

Files:
  clang-tools-extra/clangd/XRefs.cpp


Index: clang-tools-extra/clangd/XRefs.cpp
===================================================================
--- clang-tools-extra/clangd/XRefs.cpp
+++ clang-tools-extra/clangd/XRefs.cpp
@@ -298,6 +298,17 @@
                                             llvm::StringRef MainFilePath) {
   if (IDs.empty())
     return {};
+  static constexpr trace::Metric FindImplementorsMetric(
+      "find_implementors", trace::Metric::Counter, "case");
+  switch (Predicate) {
+  case RelationKind::BaseOf:
+    FindImplementorsMetric.record(1, "find-base");
+    break;
+  case RelationKind::OverriddenBy:
+    FindImplementorsMetric.record(1, "find-override");
+    break;
+  }
+
   RelationsRequest Req;
   Req.Predicate = Predicate;
   Req.Subjects = std::move(IDs);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D94393.315729.patch
Type: text/x-patch
Size: 759 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210111/b680bff3/attachment.bin>


More information about the cfe-commits mailing list