This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Refactor statistics (NFC)
AbandonedPublic

Authored by JDevlieghere on Sep 30 2021, 4:37 PM.

Details

Summary

Refactor LLDB's current statistics into a single class named Analytics which consists of different metrics.

Diff Detail

Event Timeline

JDevlieghere created this revision.Sep 30 2021, 4:37 PM
JDevlieghere requested review of this revision.Sep 30 2021, 4:37 PM
aprantl accepted this revision.Sep 30 2021, 5:54 PM
aprantl added a subscriber: aprantl.

Mechanically, this sgtm.

This revision is now accepted and ready to land.Sep 30 2021, 5:54 PM
clayborg requested changes to this revision.Sep 30 2021, 6:10 PM

please don't commit this. I am in the process of doing very similar stuff in https://reviews.llvm.org/D110804

This revision now requires changes to proceed.Sep 30 2021, 6:10 PM

I will have the new version that implements many of these changes submitted by tonight

labath added a comment.Oct 1 2021, 1:04 AM

Some general thoughts:

  • instead of throwing patches around in might be good to have a discussion thread to determine all the requirements and figure out the general direction
  • it would be better to have a series of smaller patches (like this one) instead one big patch implementing everything
lldb/include/lldb/Utility/Analytics.h
43

This assumes all statistics can be represented as integers. Here's an idea how that could be done with a flexible type representation https://godbolt.org/z/j6f3bhP8P.

lldb/source/Utility/Analytics.cpp
40–41

You could get rid of these if you made MaxID a synonym for the highest valued entry.

Some general thoughts:

  • instead of throwing patches around in might be good to have a discussion thread to determine all the requirements and figure out the general direction

Got to agree with Pavel here :-)

[Sorry, I missed the context in https://reviews.llvm.org/D110804, I should read through my reviews in chronological order.]

JDevlieghere abandoned this revision.Nov 16 2021, 1:17 PM