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

ChromeTabs #8

Open
senfi opened this issue Feb 13, 2014 · 8 comments
Open

ChromeTabs #8

senfi opened this issue Feb 13, 2014 · 8 comments

Comments

@senfi
Copy link

senfi commented Feb 13, 2014

I am pretty sure, that there is a better way to count Chrome Tabs

I used a Chrome Extension that was able to display the number of opened tabs in all Chrome windows. it should be easy to rewrite this tool to write to a file, every time the number of tabs changes.

If you are interested in this kind of chrome-extension (at least i am), i would take care of this in the next days...

@AndiH
Copy link
Owner

AndiH commented Feb 13, 2014

TL;DR: Do it!

I also have an extension installed which displays the open tabs (»Tab Count«). That's where I synchronized the ps-output with, as it was easier than counting tabs.
I don't know anything about writing Chrome plugins, to this was out of the picture for me.

Why do you think this is better? Getting the psutil output is quite good, I think.

Creating a file with the amount of tabs would still need a 'translator' to put that information into a database (you could, of course, post the information from the plugin directly into a sqlite db).
Also, counting not every five minutes but only when something changes, leads to some different data. They should be 1:1 transferable, of course, so for new data sets this should be fine. But for me, having data of a few months already, that would be severe cut. Not too important, though.

So, the only question remains: Why do you think, a Chrome plugin is better suited?

@senfi
Copy link
Author

senfi commented Feb 13, 2014

Using a Chrome plugin would give instant feedback of the tab count. But i agree that this is a problem, if you have got a huge amount of data already collected. Only plotting changes in tab count would result in gaps between data points while plotting. But this also happens, if you turn off your mac and ps isnt able to count anymore. How do you handle this case?

@AndiH
Copy link
Owner

AndiH commented Feb 13, 2014

But PS also gives instant feedback!
An upside I see with using an extension for this is that it can (maybe?) easier be done also for other browsers, e.g. Firefox… Maybe at least?

The »problem« is only a problem for people already using this. Which should be only me. So, not to much of a problem. Gaps in data series are just »no changes«. At the moment I'm handling off-time not at all, as I have not yet made a tab count evaluation which was more sophisticated than plotting all data points ;).
But translating between (every 5 minutes) and (every time the tab count changes) is just another small script, which should be no problem.

Btw: When closing 20 tabs at once, directly after another, this would lead to 20 distinct data points… so maybe there should be a minimum of 30 seconds between each tab count saving?

@Nepomuk
Copy link
Contributor

Nepomuk commented Feb 13, 2014

One could also implement something like: Save changes every 30 seconds (if there are any) and save the absolute amount every hour/day/whatever to include some redundancy as a cross-check.

@AndiH
Copy link
Owner

AndiH commented Feb 13, 2014

I'm against that. You would need to respect that in every evaluation you do. Also, I don't think you need that kind of redundancy…

@Nepomuk
Copy link
Contributor

Nepomuk commented Feb 13, 2014

Alternatively: take the changes reported from the plugin and calculate the absolute value with the last database entry. That way you cannot mess up the absolute count. And the amount of data is the same (because in both cases 32-bit integers are saved).

@AndiH
Copy link
Owner

AndiH commented Feb 13, 2014

Why would you mess up the absolute count? The extension still writes absolute values into the database.
The only difference to how it's done at the moment: Not every five minutes, but when there's a change in the tab count.

@Nepomuk
Copy link
Contributor

Nepomuk commented Feb 13, 2014

Ah sorry, I got that you wanted to save the difference in open tabs (like +1, -2) in the database. This would fail if just one entry is flawed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants