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

periodic data export #55

Open
BarKetPlace opened this issue Apr 18, 2022 · 12 comments
Open

periodic data export #55

BarKetPlace opened this issue Apr 18, 2022 · 12 comments

Comments

@BarKetPlace
Copy link

I'd like to discuss a data export functionality.
The main purpose I am seeing is the use of the data into other existing or home made co2 footprint calculation software.

the exported data would include

  • a timestamp,
  • per visited website: the data consumption, energy usage and estimated co2eq over the period.
@AAABBBCCCAAAA
Copy link

A good option (simple to implement) would be to export the data to csv/tsv.

Mainly dots generated by requests (timestamp + value).

What's your project I'm curious

@AAABBBCCCAAAA
Copy link

the feature is done in 1.3.4 of the fork.

The data is not exported automatically but instead kept in carbonalyser and when user need it (full history), it must export it via a click. It is still possible to make a periodical exporter in the download folder but until you have a good use case i think that's enough to make some analysis.

image
output data:
image

enjoy

@AAABBBCCCAAAA
Copy link

then automatic download could be used from the preference screen in 1.3.6.

@BarKetPlace
Copy link
Author

Hi thanks ! Glad you could work it out :) i ll update and test that right away

I am writing a small co2 counter for my self. I save

  • the type of food I buy and have a mapping from kg -> kgeqCO2 ,
  • the transports I take (lots of calculator online for trains/planes/car trips),
  • the internet data usage.
    Currently for internet data usage I am using vnstat to get the global count and then I transform the MB -> geqCo2 with a simple coef because I don't have the data to do better than that.

@BarKetPlace
Copy link
Author

I am not finding the Data export section, to install I have run https://addons.mozilla.org/fr/firefox/addon/carbonalyser-fork/

Have I done smth wrong ?

@AAABBBCCCAAAA
Copy link

AAABBBCCCAAAA commented May 9, 2022

I am not finding the Data export section, to install I have run https://addons.mozilla.org/fr/firefox/addon/carbonalyser-fork/

Have I done smth wrong ?

This release will be not published on amo (since it contains only one additionnal feature). So you have to download it from github : 1.3.6. The modification will be published on https://addons.mozilla.org/fr/firefox/addon/carbonalyser-fork/ later (with other modifications).

please note that this is an unsigned release

@BarKetPlace
Copy link
Author

Alright ok, but how do I install a plugin from sources ? (sorry not so experienced)

@AAABBBCCCAAAA
Copy link

Alright ok, but how do I install a plugin from sources ? (sorry not so experienced)

😅 just wait the next release on amo.

if cannot wait you can try install unsigned release (this is not the source, this it an unsigned extension) download here : 1.3.7.

Goto about:debugging#/runtime/this-firefox and load temp extension from file, choose the file "carbonalyser-1.3.7.zip".

@AAABBBCCCAAAA
Copy link

The feature has been shipped with version 1.4.1 of the fork https://addons.mozilla.org/fr/firefox/addon/carbonalyser-fork/.

You can start periodic data export from preferences screen : set general.export.autoDownload.enabled to true then validate and auto download start.
Image 1

Of course auto download is working only when firefox is running and is running when browser start
Image 3

@BarKetPlace
Copy link
Author

Thanks that's great ! I am curious about how the data are kept between reboots
Is there a location on disk where I can look for the data without having to trigger download through the browser ?

@AAABBBCCCAAAA
Copy link

AAABBBCCCAAAA commented May 20, 2022

see demo here
screen-recording.webm

The data is kept in firefox backend for the storage api (for instance in sqlite files), but for a simple solution you may not want to do that. Still accross reboot. So the location on disk is your download folder.

You don't have to trigger download each time with autodownload feature. But you need a running firefox on your machine with carbonalyser activated (some without show gui exists). Default behaviour is to download each hour, so that 's why you don't see autodownload. In video i use a shorter one (10s) just to show you it is working.

Edit: I precise location of file on disk just to be clear:

  • windows : C:\Users\user\Downloads\carbonalyser_download.csv
  • linux: ~/Downloads/carbonalyser_download.csv

So your use case is:

  1. trigger auto download in the browser once.
    2.1. n browsing session (for instance for a month).
    2.2. get the data from the location on disk (for instance from a script).

@BarKetPlace
Copy link
Author

alright yes thanks I had tested that. I was just wondering if I could get the data in another way.
Great feature ! thanks for your help

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

2 participants