Skip to content

Commit 480e5db

Browse files
committed
docs: clarify tracking_mode affects RAM and CPU (#484)
Add a dedicated "Tracking Mode" section to configuration.md explaining that tracking_mode="machine" (default) measures whole-machine RAM and CPU, while tracking_mode="process" isolates to the tracked process only. Also clarifies that GPU is unaffected by this setting.
1 parent 09cf628 commit 480e5db

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

docs/how-to/configuration.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,33 @@ Yields attributes:
8484
which relies on the [INI
8585
syntax](https://docs.python.org/3/library/configparser.html#supported-ini-file-structure).
8686

87+
## Tracking Mode
88+
89+
The `tracking_mode` parameter controls how CodeCarbon measures power consumption. It accepts two values:
90+
91+
- **`"machine"`** (default): Measures power for the entire machine — total RAM in use and total CPU load across all processes.
92+
- **`"process"`**: Isolates measurements to the tracked process — only the process's RAM usage and its share of CPU time are used to estimate power.
93+
94+
This setting affects **RAM and CPU** measurements. GPU power is always measured at the device level regardless of tracking mode.
95+
96+
Set it in your config file:
97+
98+
``` ini
99+
[codecarbon]
100+
tracking_mode = process
101+
```
102+
103+
Or directly in code:
104+
105+
``` python
106+
EmissionsTracker(tracking_mode="process")
107+
```
108+
109+
!!! note "Note"
110+
111+
`"process"` mode gives a lower-bound estimate of your code's footprint.
112+
`"machine"` mode is more conservative and accounts for all activity on the system.
113+
87114
## Access internet through proxy server
88115

89116
If you need a proxy to access internet, which is needed to call a Web

0 commit comments

Comments
 (0)