Software Carbon Intensity (SCI)
Green Metrics Tool supports custom metrics including the Green Software Foundation’s SCI
The metric is essentially a Carbon per Unit of work metric and thus is very flexible in it’s application. Supplemental to the various metric providers that the Green Metrics Tool support this introduces not only the concept of total energy / carbon per usage_scenario, but also the concept of work done.
Setup
The parts to derive the metric have to be defined in two places:
- The
usage_scenario.yml(which sets the custom metric and its unit) - The
config.yml, which sets the machine specific parameters like TE, RS etc.
The actual ticks for the unit of work (R) are captured from the containers and processes STDOUT. This has to be activated by setting log-stdout (on by default).
Setup in usage_scenario
Please see an example how to configure in our example applications repository for SCI apps.
A simple integration for an CLI based application might for instance look like this:
name: SCI Test
author: A wizard
description: SCI test scenario
services:
gcb-alpine-sysbench:
image: alpine
setup-commands:
- command: apk add sysbench coreutils gawk
custom_metrics:
calculated_prime_numbers:
unit: CPN
sci: True # optional. Will create an addtional metric gCO2e/CPN
flow:
- name: Stress
container: gcb-alpine-sysbench
commands:
- type: console
note: Starting sysbench
command: sysbench --cpu-max-prime=25000 --threads=1 --time=3 cpu run --debug=off | gawk '/total number of events:/ {cmd="date +%s%N"; cmd | getline ts; close(cmd); print ts " calculated_prime_numbers=" $NF}'
shell: shAs you can see we directly parse the output of a CLI command and the output the variable calculated_prime_numbers=… to STDOUT.
If you have an API or similar the output might not happen on the CLI directly, but rather inside a node script or similar.
Setup in config.yml
An example configuration for the config.yml is provided when the Green Metrics Tool is installed.
The values for the respective variables have to be either defined to best knowledge (like lifetime for instance) and / or
from official databases (like Embodied Carbon → and Grid Carbon Intensity →). See the respective documentation page for possible sources.
Example:
sci:
EL: 4 # means 4 years of usage
RS: 1 # means we use 1/1 = 100% of the machine. Bare metal. No virtualization
TE: 181000 # Example value for a laptop taken from https://dataviz.boavizta.org/terminalimpact. Value is in g
I: 334 # The number 334 that comes as default is for Germany from 2024. Value in gCO2e/kWhDisplay
The metric will is calculated per phase in which it occures and then aggregated in the RUNTIME as total.

If an SCI was configured and sci: True was set also the parameters will be shown in the Measurements Tab.

Formula
The SCI formula is specified by the Green Software Foundation
The components of the SCI are attributed by the GMT as follows:
- E: The energy of the total machine + the energy of the network.
- A PSU Energy provider must be activated to populate this value with the machine energy like PSU Energy XGBoost, PSU Energy MCP, etc.
- If none is activated machine energy will be excluded from the SCI.
- A Network IO provider must be activated to populate this value with the network energy.
- If none is activated network energy will be excluded from the SCI.
- A PSU Energy provider must be activated to populate this value with the machine energy like PSU Energy XGBoost, PSU Energy MCP, etc.
- I: Configured in the
config.yml. Set the intensity of your used grid location - M: Configured in the
config.yml. Set the embodied carbon of your used machine
Example applications
We provide quite some example applications that showcase how the SCI can be measured with the Green Metrics Tool for APIs, CLI tools etc.