remijouannet / graftorio2

(fork of graftorio) factorio mod for creating grafana dashboard
MIT License
77 stars 21 forks source link

add power metrics #14

Closed aritas1 closed 2 years ago

aritas1 commented 2 years ago

Adds power production and consumption metrics (#2).

This core code is a port form this graftorio PR.

I fixed some bugs and removed the event_handler overhaul.

Data are extracted via the electric_network_statistics api and power networks ids get tracked by observing pole build and description events.

A little caveat: If you split your power networks alot, factorio will sometimes increase the power network ids and you will end up with many labels.

remijouannet commented 2 years ago

@aritas1 i've reworked the code so it look more like train.lua without touching the logic, i only add a check to always rescan_world on the first tick after init/load can you please test master on your side before i release 0.0.16