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
Add an optional gramsOfCO2ePerKWh field to the meta data of processed profiles #4672
Conversation
… profile to enable customizing the carbon intensity of power tracks.
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #4672 +/- ##
=======================================
Coverage 88.47% 88.47%
=======================================
Files 295 295
Lines 26299 26299
Branches 7099 7100 +1
=======================================
Hits 23269 23269
Misses 2818 2818
Partials 212 212
☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if someone is power profiling Firefox and knows the carbon intensity of the electricity they used, it's possible to set the meta field from the devtools console before uploading (or reuploading) the profile.
I wonder where we could document this. Maybe it's about time to have a dedicated page about this in our docs, what do you think?
const { WORLD } = averageIntensity.data; | ||
return energy * WORLD; | ||
const intensity = | ||
this.props.meta.gramsOfCO2ePerKWh || averageIntensity.data.WORLD; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: use ??
instead of ||
so that we test for its absence rather than it being falsy. Indeed I guess it's theorically possible to have it set to 0 in case of 100% renewable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0 doesn't make sense, even for renewable. As an example, my renewable electricity provider estimates the carbon intensity of its electricity at 18.5g per kWh for production plus 5.15g per kWh for distribution. Using solar panels on my roof would have about the same footprint. If we wanted to support the 0 value, I would expect its meaning to be "hide everything in the UI that talks about CO2eq".
I agree, I opened #4673. |
I see this as a first step towards fixing #4479:
If we want to go one step further towards fixing #4479, I think the next step would be to have a preference in Firefox that could be set using about:config to customize the carbon intensity in Firefox, and have it included in all captured power profiles.
And a last step could be to allow setting this preference from an input field in about:profiling. I think each of these steps provides an incremental improvement and they could be done separately.