Sum time of certain status per machine


I got an metric ‘machine_metrics_status’ that exports the current status (as an int) per machine.
So for example i got 3 machines i get these values:
machine_metrics_status{machine=“Machine 1”}
machine_metrics_status{machine=“Machine 2”}
machine_metrics_status{machine=“Machine 3”}

The value of these metrics is an integer value. Every number represents a certain status.
I want to be able to calculate the time per status per machine over the time period I selected.

Do you have any suggestion how to make this calculation?