This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -18,9 +18,15 @@ Examples of available databases and services can be found on the Green Software
## Relevance for the Green Metrics Tool
Grid carbon intensity is the **I** parameter in the [Software Carbon Intensity (SCI)]({{< relref "sci" >}}) metric. The Green Metrics Tool uses grid carbon intensity to transform the measured energy consumption into carbon emissions based on local grid characteristics.
The Green Metrics Tool uses grid carbon intensity to transform the measured energy consumption into carbon emissions. It is also the **I** parameter in the [Software Carbon Intensity (SCI)]({{< relref "sci" >}}) metric.
### Configuration
## Configuration
The Green Metrics Tool supports both **static** and **dynamic** grid carbon intensity:
### Static Grid Carbon Intensity (Default)
By default, GMT uses a pre-configured **static** grid carbon intensity value. This approach ensures **reproducible measurements** (results remain consistent across different measurement times) and **fair comparisons** (measurements on the same machine with the same configuration use the same baseline for carbon intensity).
You can configure the grid carbon intensity as part of the [SCI]({{< relref "sci" >}}) configuration in `config.yml`:
Expand All
@@ -29,10 +35,40 @@ sci:
I: 334 # Grid carbon intensity in gCO2e/kWh (example value for Germany 2024)
```
GMT calculates the operational carbon emissions by multiplying measured energy consumption by the grid carbon intensity value.
You should set the grid carbon intensity to represent the typical or average value for your location.
The Green Metrics Tool uses **static** grid carbon intensity values rather than dynamic real-time data. This design choice ensures **reproducible measurements** (results remain consistent across different measurement times) and **fair comparisons** (measurements on the same machine with the same configuration use the same baseline for carbon intensity).
GMT also supports **dynamic** grid carbon intensity that fetches real-time values during measurement runs. When enabled, this provides more accurate carbon calculations based on actual grid conditions at the time of measurement. But keep in mind, that your measurements are no longer fully reproducible as carbon values vary with grid conditions.
You should set the grid carbon intensity to represent the typical or average value for your location.
Dynamic carbon intensity is configured in the machine configuration file (`config.yml`):
```yml
dynamic_grid_carbon_intensity:
location: 'DE'
elephant:
host: localhost
port: 8000
protocol: http
```
**Supported location codes:**
Only grid zone codes from [ElectricityMaps](https://portal.electricitymaps.com/developer-hub/api/getting-started#geographical-coverage) are supported (e.g., `DE`, `US-CAL-CISO`, `ES-IB-MA`, `GB`, `FR`).
Note: Depending on the configured API provider in Elephant, not all zones may be supported.
**Elephant Service:**
[Elephant](https://github.com/green-coding-solutions/elephant/) is a small service developed by Green Coding Solutions that acts as a sidecar-container. It retrieves carbon intensity data from an external service like Electricity Maps or others. It is not part of the default GMT deployment and must be set up separately if you want to use dynamic carbon intensity.
The repository includes a Dockerfile for easy deployment.
**How it works:**
When dynamic carbon intensity is enabled:
- The static `I` value in `config.yml` is ignored
- Carbon intensity is fetched from the Elephant service during measurement
- Time-series carbon data is mapped to actual energy consumption timing
- Requires access to a running Elephant service (configured within the `dynamic_grid_carbon_intensity` block)
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add dynamic grid carbon intensity #126
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
Are you sure you want to change the base?
Uh oh!
There was an error while loading. Please reload this page.
Add dynamic grid carbon intensity #126
Filter by extension
Viewed files
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing