remijouannet / graftorio2

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

Production/Consumption Data inverted - 1.2 - Default: Items - Factorio #28

Open adrianvanderwal opened 1 year ago

adrianvanderwal commented 1 year ago

While watching my stats for module production, I noticed that the graphs showed the opposite of what was happening in game.

image image

The Production graph is pulling from: image rate(factorio_item_production_output{force=~"${Force}",name=~"${Item}"}[$__rate_interval]) * ${TimeScale}, however, it is clearly displaying the consumption statistic.

adrianvanderwal commented 1 year ago

Factorio Version: 1.1.77 graftorio2 Version: 0.0.20

remijouannet commented 1 year ago

Hello, i don't fully understand, the issue is from the dashboard or from the metric itself ?

adrianvanderwal commented 1 year ago

Both (Unless the metric names have a translation issue.)

factorio_item_production_output I would take to mean Production. factorio_item_production_input I would take to mean Consumption.

The the default dashboard graphs show the data inverted.

I will try and form a more definitive response when I'm not on mobile.

remijouannet commented 1 year ago

well the issue can't be in both ways or you'll have the same issue if i invert the metric and the dashboard

remijouannet commented 1 year ago

looking at the code there is no naming error, but looking at the documentation https://lua-api.factorio.com/latest/LuaFlowStatistics.html

for item consumption = output Production = input

adrianvanderwal commented 1 year ago

for item consumption = output Production = input

That would make more sense. The issue is then simply on the default dashboard - 1.2 - Default Items.

The current production graph panel shows that the query is: rate(factorio_item_production_output{force=~"${Force}",name=~"${Item}"}[$__rate_interval]) * ${TimeScale}

Kariton commented 1 year ago

hey @adrianvanderwal, im sorry for the inconvenience.

i will looke into that and fix my dashboards. additionaly im currently working on more stats, metadata and other inprovements that can be made.

stay tuned! :)