Naereen / uLogMe

:bar_chart: :chart_with_upwards_trend: Automatically collect and visualize usage statistics on Ubuntu, with :musical_keyboard: key frequencies and :computer: window titles →
https://Naereen.GitHub.io/uLogMe/
MIT License
67 stars 14 forks source link

Tools for tuning render_settings.js #20

Closed nealmcb closed 6 years ago

nealmcb commented 7 years ago

Most people will have to tune render_settings.js quite a bit, and won't really know what they're looking for when they start. Rather than having them edit it right off the bat, I'd suggest that they open it up and look at it for a bit but then just gather data for a while before coming back to it.

Then they'll want to tune it. One way to do that is of course to run the server and play with the pretty visualizations. But they will just look kind of messed up to begin with. E.g. I had nothing much in Browsing or Coding, so they were squashed together overwriting each other in the Activity breakdown.

Another way would be to parse their titles collected so far using the render_settings.js functions, and find out what is happening with the most common titles: which weren't matched at all, what mappings are being applied to them, what activity groups they're ending up in, etc. After getting some reasonable classifications of those types for the common ones, the current GUI will make more sense.

So my concrete question is: is there a simple way, e.g. via the command line, to run one of the window*.txt files thru those functions and get output like this to work with:

group mapped_title title
Coding GitHub Issues · Naereen/uLogMe - Google Chrome
Social GMail Inbox – example@gmail.com - Google Chrome
Fun VLC VLC media player
UNKNOWN UNKNOWN *Shell Command Output*

This also prompts me to wonder (probably best for another issue or two) how to better classify Emacs buffer names, tmux tabs, etc. They are where I spend most of my time, including email (mutt), coding etc....

Naereen commented 7 years ago

That's interesting, I don't have time right now but will look into it this weekend! Thanks

For your other questions, if tmux is correctly configured your terminal title should change in every tabs, and if you name your tabs with meaningful name, the render_settings.js can be used to affect them to different activity. Same for Emacs buffer I guess. I tweaked the settings to find out which language I edit using both Sublime Text and VS Code, I'm sure you can do the same for Emacs!

Naereen commented 7 years ago

But I cannot include the configuration for any editor in the default settings, of course. I advise you open another issue, and maybe try to tweak the settings yourself, and then post your solution in the issue ticket (for reference for future users)

Naereen commented 7 years ago

Hi again, Sorry for the delay. I will do it asap.

As the parsing and reading of logs files is already one by the Python script, and the analysis of the json files (with the filters) is done with the Javascript script, I will try to write a nodejs cli script that first calls the Python export_events.py script and then print nicely the result of filtering the json with the filters.

Naereen commented 6 years ago

Sorry, I never had and will probably never have the time for this.