diff --git a/cmd/export/readMetrics.go b/cmd/export/readMetrics.go index 8d72cfa..a97102c 100644 --- a/cmd/export/readMetrics.go +++ b/cmd/export/readMetrics.go @@ -29,7 +29,7 @@ func (cfg *config) gatherMetrics() { cfg.Prometheus.CurrentMa.With(prometheus.Labels{"device": host}).Set(float64(m.Emeter.GetRealtime.CurrentMa / 1000.0)) cfg.Prometheus.VoltageMv.With(prometheus.Labels{"device": host}).Set(float64(m.Emeter.GetRealtime.VoltageMv / 1000.0)) cfg.Prometheus.PowerMw.With(prometheus.Labels{"device": host}).Set(float64(m.Emeter.GetRealtime.PowerMw / 1000.0)) - cfg.Prometheus.TotalWh.With(prometheus.Labels{"device": host}).Add(float64((m.Emeter.GetRealtime.TotalWh - tracker[host]) / 1000.0)) + cfg.Prometheus.TotalWh.With(prometheus.Labels{"device": host}).Add(float64(m.Emeter.GetRealtime.TotalWh - tracker[host])) tracker[host] = m.Emeter.GetRealtime.TotalWh } time.Sleep(time.Duration(time.Second * 15))