Skip to content

Commit

Permalink
Use Gauge.Set() instead of IncTo() coming from counters
Browse files Browse the repository at this point in the history
  • Loading branch information
awaescher committed May 15, 2024
1 parent 60eba18 commit ecdac20
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions MaxPower/HostedServices/ExporterService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ protected override async Task ExecuteAsync(CancellationToken cancellationToken)
var data = await MaxTalkClient.RequestAsync(inverter.Ip, inverter.Id, inverter.Port);

string[] labels = [inverter.Ip, inverter.Id.ToString()];
_energyDay.WithLabels(labels).IncTo(data.EnergyDay);
_energyMonth.WithLabels(labels).IncTo(data.EnergyMonth);
_energyYear.WithLabels(labels).IncTo(data.EnergyYear);
_energyTotal.WithLabels(labels).IncTo(data.EnergyTotal);
_energyDay.WithLabels(labels).Set(data.EnergyDay);
_energyMonth.WithLabels(labels).Set(data.EnergyMonth);
_energyYear.WithLabels(labels).Set(data.EnergyYear);
_energyTotal.WithLabels(labels).Set(data.EnergyTotal);
}
catch (Exception ex)
{
Expand Down

0 comments on commit ecdac20

Please sign in to comment.