Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[clangd] Add metric for rename decl kind #83867

Merged
merged 2 commits into from
Mar 5, 2024

Conversation

DavidGoldman
Copy link
Contributor

This will give us insight into what users are renaming in practice - for instance, try to gauge the impact of the ObjC rename support.

This will give us insight into what users are
renaming in practice.
@llvmbot
Copy link
Collaborator

llvmbot commented Mar 4, 2024

@llvm/pr-subscribers-clang-tools-extra

@llvm/pr-subscribers-clangd

Author: David Goldman (DavidGoldman)

Changes

This will give us insight into what users are renaming in practice - for instance, try to gauge the impact of the ObjC rename support.


Full diff: https://github.com/llvm/llvm-project/pull/83867.diff

1 Files Affected:

  • (modified) clang-tools-extra/clangd/refactor/Rename.cpp (+4)
diff --git a/clang-tools-extra/clangd/refactor/Rename.cpp b/clang-tools-extra/clangd/refactor/Rename.cpp
index 4e135801f6853d..0cc7eecd6212be 100644
--- a/clang-tools-extra/clangd/refactor/Rename.cpp
+++ b/clang-tools-extra/clangd/refactor/Rename.cpp
@@ -1072,6 +1072,10 @@ llvm::Expected<RenameResult> rename(const RenameInputs &RInputs) {
   if (Reject)
     return makeError(*Reject);
 
+  static constexpr trace::Metric RenameTriggerCounter(
+      "rename_trigger_count", trace::Metric::Counter, "decl_kind");
+  RenameTriggerCounter.record(1, RenameDecl.getDeclKindName());
+
   // We have two implementations of the rename:
   //   - AST-based rename: used for renaming local symbols, e.g. variables
   //     defined in a function body;

clang-tools-extra/clangd/refactor/Rename.cpp Outdated Show resolved Hide resolved
@DavidGoldman DavidGoldman merged commit ec7062d into llvm:main Mar 5, 2024
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants