|
| 1 | +--- |
| 2 | +title: "Network IO - procfs - system" |
| 3 | +description: "Documentation for NetworkIoProcfsSystemProvider of the Green Metrics Tool" |
| 4 | +date: 2025-07-22T17:50:00+00:00 |
| 5 | +weight: 201 |
| 6 | +--- |
| 7 | + |
| 8 | +### What it does |
| 9 | + |
| 10 | +It reads the cumulative amount of bytes received and transmitted on each |
| 11 | +network interface of the host by parsing `/proc/net/dev`. This allows |
| 12 | +monitoring system-wide network usage independent of containers. |
| 13 | + |
| 14 | +### Classname |
| 15 | + |
| 16 | +- `NetworkIoProcfsSystemProvider` |
| 17 | + |
| 18 | +### Metric Name |
| 19 | + |
| 20 | +- `network_io_procfs_system` |
| 21 | + |
| 22 | +### Input Parameters |
| 23 | + |
| 24 | +- args |
| 25 | + - `-i`: interval in milliseconds |
| 26 | + |
| 27 | +By default the measurement interval is 100 ms. |
| 28 | + |
| 29 | +```bash |
| 30 | +./metric-provider-binary -i 100 |
| 31 | +``` |
| 32 | + |
| 33 | +### Output |
| 34 | + |
| 35 | +This metric provider prints to Stdout a continuous stream of data. The format of |
| 36 | + the data is as follows: |
| 37 | + |
| 38 | +`TIMESTAMP RECEIVED_BYTES TRANSMITTED_BYTES INTERFACE` |
| 39 | + |
| 40 | +Where: |
| 41 | +- `TIMESTAMP`: Unix timestamp, in microseconds |
| 42 | +- `RECEIVED_BYTES`: Total bytes received by the interface since system boot |
| 43 | +- `TRANSMITTED_BYTES`: Total bytes transmitted by the interface since system boot |
| 44 | +- `INTERFACE`: Name of the network interface (for example, eth0) |
| 45 | + |
| 46 | +Any errors are printed to Stderr. |
| 47 | + |
| 48 | +### How it works |
| 49 | + |
| 50 | +The provider reads the counters from `/proc/net/dev` for every network |
| 51 | +interface. The values are sorted by interface and timestamp. Optionally, virtual |
| 52 | +interfaces are filtered out so only physical network adapters are included. |
| 53 | + |
| 54 | +For each interface, the difference between consecutive measurements is computed |
| 55 | +internally to obtain the bytes transmitted during the sampling interval. The |
| 56 | +sum of received and transmitted bytes forms the final value reported for the |
| 57 | +interval. |
| 58 | + |
| 59 | +System-wide network traffic is not attributed to specific containers. When |
| 60 | +analyzing energy consumption based on these values, you may combine them with the |
| 61 | +[Network Carbon Intensity →]({{< relref "../carbon/network-carbon-intensity" >}}) |
| 62 | +page for further guidance. |
0 commit comments