Giter VIP home page Giter VIP logo

carbonalyser / carbonalyser Goto Github PK

View Code? Open in Web Editor NEW
147.0 11.0 37.0 141 KB

The add-on "Carbonalyser" allows to visualize the electricity consumption and greenhouse gases (GHG) emissions that your Internet browsing leads to.

Home Page: https://theshiftproject.org/en/carbonalyser-browser-extension/

License: MIT License

JavaScript 74.69% CSS 7.43% HTML 17.88%
addon ecology carbon-emissions firefox-addon chrome-extension

carbonalyser's Introduction

Carbonalyser

Installation

Overview

The add-on "Carbonalyser" allows to visualize the electricity consumption and greenhouse gases (GHG) emissions that your Internet browsing leads to.

Visualizing it will get you to understand that impacts of digital technologies on climate change and natural resources are not virtual, although they are hidden behind our screens.

To evaluate these impacts, the add-on:

  1. Measures the quantity of data travelling through your Internet browser,
  2. Calculates the electricity consumption this traffic leads to (with the "1byte" model, developed by The Shift Project),
  3. Calculates the GHG emissions this electricity consumption leads to, following the selected location.

Features

"Run analysis / Stop analysis" - run or stop the measuring of data volume travelling through the Internet browser. Results shown in the pop-up window are calculated for the cumulated running time.

"Reset data" - erase measures and calculations made during the running time to reset the analysis to zero.

Chart area - features rankings of the top 5 websites in terms of data traffic and their share in the total data volume generated by browsing the Internet.

"Select your location" - allow to choose the electrical mix to apply in the calculations of GHG emissions (by default, if none is selected: average world mix is taken)

Results area - features:

  • Time during which the device has been running, from the start of the analysis,
  • Quantity of data generated by Internet browsing,
  • Electricity consumption generated by data traffic,
  • GHG emissions this leads to,
  • Comparison of GHG emitted by browsing and GHG emitted by charging a smartphone,
  • Comparison of GHG emitted by browsing and GHG emitted by driving a car.

The box "How to change that? What responsibility?" links to publications from The Shift Project about environmental impact of our digital uses and solutions we have at individual and collective scales.

Privacy

None of your data are collected: all browsing data are analyzed directly on the user device and are not sent or processed anywhere else in any way.

The source code of this program is available in open access, to ensure transparency and for any other purpose.

Methodology

See: https://theshiftproject.org/en/carbonalyser-browser-extension/

Support & source code

Questions, bug reports and feature requests are to be addressed to [email protected]

Source code is available in open access: https://github.com/supertanuki/Carbonalyser

Contributors

Developer: Richard Hanna.

Designer: Gauthier Roussilhe.

In partnership with Maxime Efoui-Hess for The Shift Project.

carbonalyser's People

Contributors

carbonalyser avatar cguignol avatar katrinleinweber avatar lucaheise avatar supertanuki avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

carbonalyser's Issues

Inconsistent input data

Hi,
your input data in Carbonalyser/popup/popus.js lines 5 + 6

5 const kWhPerByteDataCenter = 0.00000000072;
6 const kWhPerByteNetwork = 0.00000000152;

are inconsistent with your reference, the 1byte model presented in https://theshiftproject.org/wp-content/uploads/2018/10/Lean-ICT-Materials-1byte-Model-2018.xlsx

There, these two numbers are a factor of 10 smaller, leading to a tenfold overestimate of the value for gCo2e in the app, compared to what the reference would predict.

Cheers.

Use custom kWhPerByteDataCenter system.

Currently we use the same kWhPerByteDataCenter for all datacenters.

However electricity is not all consumed in the same country so we have to take that in account when computing the result.

We could identify the location in which the site is located with ip addresses then apply a local kWhPerByteDataCenter instead of the global one.

We could be wrong if there is a relay between. But in practice we're still right in most cases because relay are CDN and other fast delivery network so they will be near original user location (and near of original result).

Recherche dev pour extension inspirée de Carbonalyser

Je recherche un développeur javascript pour réfléchir et faire un fork et une évolution de Carbonalyser (et sans doute sous un autre nom) qui sera open sourcée, et sera destinée d'abord aux agents du secteur public français.
Comme fonctionnalités possibles, le suivi journalier ou hebdomadaire de la conso internet.
Prestation rémunérée bien sûr.
Me contacter : richard.hanna at modernisation.gouv.fr

Downloads not counted in consumption

I spend a good part of my job uploading et downloading big files (video editing) via WeTransfer or Drive. This is not taken into account for my statistics. As an example, the tracker tells me that last month I used 10105Mo of data and this is significantly lower compared to what I really used (~100Go for last month). Therefore my statistics and consumption are quite off...

Could you add a feature such that all downloads are taken into account ?

View more results, history

Init a "more results" link (name to be refined) after the top 5 urls, thats open a new browser tab

  • history of one week of navigation impact (duration, Mo, gco2eq, kWh).

We will need to store new data per day.

Use IEC definition of Megabyte

The fact is that from the number of bytes we define

toMegaByte = (value) => (Math.round(value/1024/1024));

However this seem more like a toMebiByte definition according to wikipedia page.

IEEE, EU, ISO and NIST has adopted the IEC system so we can consider as the official one.

Use more detailled factors for compute of CO2 emission equivalents.

For instance https://api.carbonintensity.org.uk/ we could get carbon intensity even by the region that user give us or that we found from his location.

What could be nice with this is that even in futur you don't have to update manually values such as defaultCarbonIntensityFactorIngCO2PerKWh.

We could also use carbon intensity from https://www.eea.europa.eu/data-and-maps/daviz/sds/co2-emission-intensity-from-electricity-generation-5/@@view for other countries.

Ignore data from localhost

Hi !

Thanks for your very nice plugin.

By developing a React project, I've seen that the http://localhost:8080 is included in the analysis.

Maybe the plugin should ignore such cases because there is no internet bandwith usage associated with localhost project (exept API resquests or network images for example).

Choose between network type (4G hotspot, WI-FI ...)

Hi,

I read on the Shift Project report that there are not the same data footprint if you are using mobile network or WI-FI network (model 1byte).

Sometimes people use their computer with a mobile network by the hostpot feature. it would be great to have the possibility to change the type of network, even manually, since the difference between WIFI and mobile is about *3 according to the 1byte model :)

thanks for your work !

mistake in charged smartphones

to compute recharged smartphones you use GESgCO2ForOneChargedSmartphone.

mean that bytes/device time -> power -> gCO² -> charged smartphones.

so if you change the carbon intensity factor, the number of charged smartphones will change the for the same amount of electricity

so the good behaviour should be : use electricity consumption instead.

bytes/device time -> power -> charged smartphones

Ideas for additional features

Hello,
With a team of the organisation Data for Good Marseille, we are motivated to work for adding features to Carbonalyser and helping this tool to be used by general public.

We asked several people who didn't know the Carbonalyser and who weren't all comfortable with tech, to tell what they would like to see on it, in order to increase its impact.

Here are some of their interesting answers. What do you think about it ?

  • To add a kind of pop-up that congratulates you if your consumption is decreasing.
    Or more generaly a pop-up that tells you how your consumption evolves (but how, without being guilt and intrusive ?)

  • To replace the grey links (not very visible) and the one below ("Comment changer cela ?") by 4 pictograms, with 4 links :
    -> 1 about important figures and comparisons (1h of Netflix, of Youtube = ...), and explaining what is this consumption (data centers...)
    -> 1 giving advice to change that (like those in the app, with more details for "non-tech" people)
    -> 1 explaining what is the Shift Project
    -> 1 explaining how the Carbonalyser works (reassuring on the use of data, and explaining the calculation)

  • To show the evolution on several days or weeks

  • To allow to choose the kind of comparisons (how many km of cars, or plane, bulbs, heaters, washing machine...) [also a way to sensitize to the impact of these things]
    It could be with a scrolling menu.

  • To compare the distribution of Mo consumed to the distribution of time spent (to show heavy websites).
    Or at least writing that figures are about Mo and not time.

  • Giving a figure of the limit we shouldn't exceed for a sustainable lifestyle.
    Or telling how many trees would compensate for this CO2.

  • On the app : giving also the distribution of comsumption by website

  • Explaining how opened and unused apps and tabs are consuming

But people say it must be clear and not with to much information, so there may be a choice to do among all these ideas ^^

Decimal place and separator

Hi,
thanks for this nice plugin. A small notation issue, which made much irritation on my side:
In the overview how much energy/co2 I produced, in my case, its written:
1.547 kWh
3.636 km of car drive

As a german I am used to have , as decimal seperator and . as thousands seperator. Therefore my first thought was: What the hell, nearly 4 thousand km of car drive???

My suggestion for this issue is:

  • the nice way of course would be a "translation" into local seperators, and maybe at the same time also a language translation
  • the quick fix: do not write so many decimal places. just write 1.5 kWh instead of 1.547 and 3.6 km. This would make it directly clear that this is NOT a decimal seperator and furthermore it is more realistic as you probably can not measure the kWh and the km with such a high precision, which would justify so many decimal places.

Thank you for the time you put into this project!
twain

recommend addons to users that prevent useless

i know the project a litle sleepy but why instaed of taking user to kind of fatality did you do not instead redirect it to browser extension that could greenify browsing eg. It sounds like use is responsible of alll whet's going wrong about climate ( but in fact not it's software provider that give it to user the true responsible ). Then when all have been done on the software dev side then maybe advertise users.

ecoify

decentral eyes

Help with clarifying what `kWhPerByteDataCenter` refers to in the extension

Hello there!

I have a question about this lone of code here:

https://github.com/supertanuki/Carbonalyser/blob/52e8c50583853447b7574eb1e12cfb71dfbf22d0/popup/popup.js#L5

And I'm asking in the context of these variables defined here:

const defaultCarbonIntensityFactorIngCO2PerKWh = 519;
const kWhPerByteDataCenter = 0.00000000072;
const kWhPerByteNetwork = 0.00000000152;
const kWhPerMinuteDevice = 0.00021;

In particular, I'm trying to understand this part here kWhPerByteDataCenter - does this refer to the estimated energy used by the final website you're connecting to?

So, if I'm connecting to http://github.com, I currently understand these to basically correspond to:

  • kWhPerByteNetwork - the estimated energy transferring packets of data through the network (the networks between me and github)
  • kWhPerByteDataCenter - the estimated energy used by the datacentre(s) running the web application I am connecting to (i.e. github's servers)
  • kWhPerMinuteDevice - the estimated energy from the device you're holding or using (i.e. my phone, or a laptop)

What I am basing this on

I'm basing this on page 72 of the English version of the Lean ICT Report, published by the Shift Project:

Calculation methodology: "1 byte" model

The impacts are calculated for a unit performance of the action considered, based on the electric energy needed for this performance in kWh.

The approach chosen consists in evaluating the average energy impact (electric energy) of one byte of data via a model, the "1byte"model, built by the working group, then calculating theimpact of the action with respect to the size of the data involved to perform it.

The quantification of this unit impact is done in kWh/byte. Three contributions are considered:

  • The electricity consumption associated with using the terminal on which the action is performed;
  • The electricity consumption generated by the activity of the data centers involved in transferring the data;
  • The electricity consumption generated by the activity of the other network infrastructures during the transfer of the data.

The contribution of the terminal is calculated for two cases:the performance of an action on a smartphone and an action on a laptop computer. The consumption due to using the terminal is calculated on the basis of the hourly consumption of the terminal and the duration of use associated with the action

I'm asking, as I'm working with the Green Web Foundation, and we'd love to be able to refer to this extension and prior work with our own tools and datasets

My question

Can you please tell me if this is the case?

We use the Greencheck API to give information about if an host/origin that you are connecting to runs on green power, and I'm trying to see how to incorporate this research into our own work when talking about the the environmental impact of the web.

firefox version to make it work

I installed the extension on Firefox 52.6.0 and I can run it but I don't see results. When I run the analysis I just see the message "Analysis in progress. Start browwing the web, then com back here to get stats". I've been browing for a bit while and nothing is shown.

Improve measure of the number of bytes by adding cost of HTTP headers.

Correct me if i'm wrong but HTTP header is not taken in account. It is important because they contains site depends data that is useful to compare sites consumption.

My point is that we could take in account HTTP header contained in the request:
for all response header get length of the header title + content.

It is not peanut. Example Cookie header (371 bytes).
This data is not held in datacenter but generated dynamically so we just have cost of transit over network. Maybe you already take this cost in account ?

Original code:

  let duration = localStorage.getItem('duration');
  duration = null === duration ? 0 : duration;

  const kWhDataCenterTotal = stats.total * kWhPerByteDataCenter;
  const GESDataCenterTotal = kWhDataCenterTotal * defaultCarbonIntensityFactorIngCO2PerKWh;

  const kWhNetworkTotal = stats.total * kWhPerByteNetwork;
  const GESNetworkTotal = kWhNetworkTotal * defaultCarbonIntensityFactorIngCO2PerKWh;

  const kWhDeviceTotal = duration * kWhPerMinuteDevice;
  const GESDeviceTotal = kWhDeviceTotal * carbonIntensityFactorIngCO2PerKWh[userLocation];

  const kWhTotal = Math.round(1000 * (kWhDataCenterTotal + kWhNetworkTotal + kWhDeviceTotal)) / 1000;
  const gCO2Total = Math.round(GESDataCenterTotal + GESNetworkTotal + GESDeviceTotal);

  const kmByCar = Math.round(1000 * gCO2Total / GESgCO2ForOneKmByCar) / 1000;
  const chargedSmartphones = Math.round(gCO2Total / GESgCO2ForOneChargedSmartphone);

So you add size of header generated by website:

  const kWhNetworkTotal = (stats.content.total + stats.headers.total) * kWhPerByteNetwork;
  const GESNetworkTotal = kWhNetworkTotal * defaultCarbonIntensityFactorIngCO2PerKWh;

Question regarding the computation of `kWhDataCenterTotal`

Hi,

First thanks for this great extension!
I have a question regarding the way kWhDataCenterTotal is computed
https://github.com/supertanuki/Carbonalyser/blob/6ddda736cc03f1330891dfb0d270676d425910dc/popup/popup.js#L99

As I understand, it is the total number of bytes transferred times kWhPerByteDataCenter. And kWhPerByteDataCenter is an estimation provided by the Shift Project of the number of kWh to store one byte in a data center. But this is to store one byte in a data center during one year. Here if I go to a webpage, I will transfer for example (among others) an index.html file. This index.html file (whose size is 1kB) is stored in one data center (for simplicity). So storing it during one year costs 0.00000072 kWh. This cost should be shared among all the people that will retrieve this file during the year.

I understand that knowing how many people downloaded a given file is hard to tell. But I guess that most of the time this cost would be negligible compared to the transfer, no?
Or did I misunderstand what kWhPerByteDataCenter represents?

Thanks!

Data Policy

Add the policy when only the "start" button (without data) is displayed in the popup.

Aucune donnée n’est transmise à l’extérieur lors de l’utilisation de cette extension : les données sont comptabilisées directement dans votre navigateur et ne sont ni communiquées, ni conservées d’une quelconque manière.

None of your data are collected when using our add-on “Carbonalyser”: all browsing data are analyzed directly on your browser and are not sent or processed anywhere else in any way.

Taking browser/server cache into account

Thanks for this project. I was looking for such a tool. However, it looks like Carbonalyser does not properly take caching into account.

Concerning my Internet browsing, this results in wrong orders of magnitude for the importance of different websites. Indeed, when browsing on, say GitHub all day long, CSS, JS or image assets are loaded only once (and not 100 or 1000 times per day).

There are (at least) two situations that need to be handled correctly:

  1. The browser does not send the query to the server, but loads the resource from it's own cache. This should not count in "data center" and "data transfer" kWh or CO2 costs.
  2. The brower sends a request but the server returns an HTTP 304 (resource not modified) status code. Then there is a request but only of very small size. The full size of the resource should not count in "data center" and "data transfer" kWh or CO2 costs since it is loaded from cache and only a very small query was made.

Overestimation of the weight of the website when reloading the page without cache several times in a row

Hi, I think there's a mistake when estimating the weight of a website on chrome. When testing with any website when reloading the page several times without the cache you can see that the number of mo indicated does not increase proportionally.
For example, if I load the rts.ch page once, the extension tells me that I have downloaded 7 mo. If I refresh the page, the extension now shows me 19 mo. By repeating the operation I get 50 MB.
I find this strange because I don't scroll in the page, I don't open any other site during this time and I empty the cache each time I reload the page.

Is it me who doesn't understand how the extension works or is there a bug?

Sorry for my bad english it's not my native language.
Thanks for this great extension by the way !

Any tool for LAN and/or DNS analysing?

Hi,

Great tool. I'm looking for a similar tool for a personnal DNS server or LAN router. Or even more complex and complete tool to monitor LAN/servers.

Thanks,
A.

Proposals for graphism

Hello, I create a second issue, after the ones about additional features, with the ideas of "lambda" people who tested the Carbonalyser (and also from a graphics specialist).

Here are some of their ideas of changes for the text or the layout to increase its impact :

  • On the pie chart : indicate the number of Mo (not just %)

  • For more impacting figures : giving rather the distance by car in meters (not km),
    and the number of hours for smartphone charging.

  • « Top 5 du trafic relatif à votre navigation » : to write it in black and bold

  • To refine (and so clarify) :
    -> Choice of country : make a smaller tab, with just the indication "It refines the result" (more details in a link)
    -> On the Top 5 of the figures -> remove the "www" from the address of the sites
    -> Keep the content short enough so that there is no scrollbar on the plug-in
    -> Replace the sentence "In .. minutes of navigation…. "With" Your… navigation minutes correspond to: " (remove the rest of the sentence, give the other figures only with the pictograms).
    Put this part at the very top first.
    Color the pictograms.

Do you also agree with these ideas ?

Can't run script.js

I a student in computer science and I need to analyse the plugin for a project but I have some issues.
When trying to run script.js, there is an error : "ReferenceError: chrome is not defined".
I can't find why. Any suggestions ?

Otherwise, how to launch Carbonalyser in a web page ? What do I need to run ?

Waiting for answers. Thanks in advance.

gCO2e/kWh en France

@supertanuki j'ai un doute sur la variable carbonIntensityFactorIngCO2PerKWh

https://github.com/supertanuki/Carbonalyser/blob/809d43f05a10241d27374f6548528ff15df38bb2/popup/popup.js#L14

D'où vient ce chiffre ? J'ai l'impression que c'est une grosse sous-estimation de l'impact du kWh en France.

A l'heure où j'écris ces lignes, dans le premier froid automnal, on est à 124g d'après electricitymap.org.

D'après wikipedia,

Les émissions unitaires de CO2 pour la production d'électricité sont évaluées à 79 g de CO2 par kWh en 2010 contre 347 g pour l'Union européenne à 27

J'ai peut-être loupé un facteur quelque part 😅

Publication sur Chrome Web Store

La publication sur Chrome Web Store a été refusée :

Votre élément ne respectait pas la section suivante de notre Règlement du programme :

"Confidentialité des données utilisateur"

Votre produit ne respecte pas la section sur l'utilisation des autorisations décrite dans les règles, qui exige que vous suiviez les consignes suivantes :

  • Demander les autorisations nécessaires les plus limitées pour exécuter les fonctionnalités ou les services de votre produit.
  • Par exemple, si plusieurs autorisations peuvent être utilisées pour exécuter une fonctionnalité, vous devez demander celles offrant l'accès le plus restreint aux données ou au mode de fonctionnement.
  • Ne pas essayer de protéger votre produit contre l'obsolescence en demandant une autorisation susceptible de bénéficier à des fonctionnalités ou à des services qui n'ont pas encore été mis en œuvre.

Window height too small

The window is a bit too small on Firefox/Windows 10 (see picture). The scroll should be removed.

carbonsize

Consommation de données pour Peertube

Hello,

Une utilisatrice de l'instance Peertube que je gère me fait part du problème suivant à partir d'une analyse de Carbonalyser :

j’ai regardé 3 conférences en replay de la journée du lundi il y a plus d’un mois et cela représente 85% du total de ma consommation énergétique de mon ordinateur. A titre de comparaison j’ai suivi une formation en ligne de 16h (hors Youtube) et je suis étonnée du résultat. A checker de votre côté, cela peut aussi être un bug du tracker.

J'ai fait part du problème à la communauté Peertube (ici : https://framacolibri.org/t/consommation-energetique-de-peertube/10257) qui pense que le problème vient du calcul de Carbonalyser

Une idée du pourquoi ? Et si c'est un problème contextuel ou généralisé / à Carbonalyser ?

Merci !

Feature request: support Chrome

Thanks for the pretty interesting plugin.
While I'm a pretty happy firefox user, I'm afraid that chrome seems to have roughly 6 times more users than firefox. Supporting chrome would help spread the message!

Add-on Google Chrome / Edge disabled by Google

In french : l'extension a été désactivée par Google pour la raison suivante :

Règles non respectées :
Utilisation des autorisations :
Référence du cas de non-respect du règlement : Purple Potassium
Description du cas de non-respect du règlement : les autorisations suivantes sont demandées, mais pas utilisées :
storage
Solution : supprimez les autorisations ci-dessus
Extrait du règlement du programme :
Demandez les autorisations nécessaires les plus limitées pour exécuter les fonctionnalités ou les services de votre produit. Ne demandez pas d'autorisations pour des fonctionnalités ou services que vous n'avez pas encore implémentés dans l'intention de préparer votre Produit pour l'avenir.

Or, le storage est utilisé pour stocker les données.

periodic data export

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.