[inspect] Introduce analytics by alexander-yakushev · Pull Request #329 · clojure-emacs/orchard (original) (raw)
Now this is a feature I had on my mind for quite some time, and one I'm very excited about. The idea is to have all kinds of analytics that the inspector can automatically (on demand) compute when the user inspects a large collection of data. It happens very often to me that I inspect something big and can't really grasp some characteristics of that data just by looking at it visually at the inspector, and I start running all the things on it like frequencies
, (map type coll)
, etc. Having the inspector do it without leaving the inspector window is crazily convenient.
Bonus: we can present the analytics data using the inspector itself. I'm almost crying as I'm writing this. It is a thing of beauty; Father McCarthy smiles upon us from heaven.
Some screenshots how it would look like in the end:
Things it can do so far:
- For any list: frequencies of values, frequencies of value types
- Basic numerical stats on lists with numbers (min, max, mean, number of zeros)
- Very basic string stats on lists with strings (number of blanks, min, max, avg length)
- Same but on lists of lists
- For keyvalues (maps k->v): separate list analysis of keys and of values
- For lists of tuples: separate list analysis of each "vertical slice" (treat all first values as list 1, all second values as list 2, etc.)
- For lists of "records" (maps of the same structure): separate list analysis on values under each key.
Extras:
- Configurable cutoff limit (100,000 by default). Only that many values from the head of the list will be analyzed.
- A hint about this feature that is displayed to the user until they trigger analytics for the first time. Will serve the discoverability function.
I have a dream that as people start using it, we together can come up with more ideas what to compute and make this feature even awesomer.
- You've added tests to cover your change(s)
- All tests are passing
- You've updated the changelog (if adding/changing user-visible functionality)