Skip to content

feat: Add per-machine consumption metrics and recipe label - #35

Merged
AP-Hunt merged 3 commits into
AP-Hunt:mainfrom
jwalker343:add-machine-consumption-metrics
Aug 18, 2026
Merged

feat: Add per-machine consumption metrics and recipe label#35
AP-Hunt merged 3 commits into
AP-Hunt:mainfrom
jwalker343:add-machine-consumption-metrics

Conversation

@jwalker343

@jwalker343 jwalker343 commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

What is this?

This PR adds 3 per-machine consumption metrics:

  • machine_items_consumed_per_min
  • machine_items_consumed_pc
  • machine_items_consumed_max

with a goal of answering this question: What machines/recipes are using all the rubber in my factory.

This PR also adds the recipe label to these existing metrics for both symmetry and clarity on the actual output recipes. (Alts vs base)

  • machine_items_produced_per_min
  • machine_items_produced_pc
  • machine_items_produced_max

Example dashboard:

image

Notes

All of this data was already sourced from FRM, just not exported as metrics, so no additional calls are made back to FRM.

It is possible that adding the recipe label to existing metrics may be a breaking change for some dashboards, would appreciate testing and advice there.

Full Disclosure: Claude wrote the code changes and tests, I reviewed everything.

FRMC already parses each building's Recipe and Ingredients from
getFactory, but never exposed consumption as a metric, only
production. This adds machine_items_consumed_per_min,
machine_items_consumed_max, and machine_items_consumed_pc,
mirroring the existing produced-item metrics.

Also adds a recipe label to both the produced and consumed
machine metrics, sourced from the same already-parsed Recipe
field. Without it, there's no way to tell which recipe variant a
machine is running when multiple recipes share an output item.
Adds coverage for machine_items_consumed_per_min, _max, and _pc,
including a multi-ingredient case. Updates existing assertions
for the new recipe label on the produced-item metrics.
Adds the three new machine_items_consumed_* rows and the recipe
label on the existing machine_items_produced_* rows.
@AP-Hunt

AP-Hunt commented Aug 18, 2026

Copy link
Copy Markdown
Owner

Hi @jwalker343

Thanks for taking your time to add this, I appreciate it. I also appreciate the transparency on the LLM. I've reviewed it all and I'm happy with it. I'm going to merge it now, and cut a release this evening.

@AP-Hunt
AP-Hunt merged commit 6c2480b into AP-Hunt:main Aug 18, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants