From e144b1fb28829f232019f97a2caeed6081da20d7 Mon Sep 17 00:00:00 2001 From: egmc Date: Sat, 6 Jan 2024 17:00:36 +0900 Subject: [PATCH] remove unused function Signed-off-by: egmc --- systemd/systemd.go | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/systemd/systemd.go b/systemd/systemd.go index 275dd87..85a9df7 100644 --- a/systemd/systemd.go +++ b/systemd/systemd.go @@ -31,8 +31,6 @@ import ( "github.com/go-kit/log/level" "github.com/pkg/errors" "github.com/prometheus/client_golang/prometheus" - - godbus "github.com/godbus/dbus/v5" ) const namespace = "systemd" @@ -245,6 +243,7 @@ func (c *Collector) Describe(desc chan<- *prometheus.Desc) { desc <- c.ipEgressBytes desc <- c.ipIngressPackets desc <- c.ipEgressPackets + } func parseUnitType(unit dbus.UnitStatus) string { @@ -252,18 +251,6 @@ func parseUnitType(unit dbus.UnitStatus) string { return t[len(t)-1] } -func parseProperty(object godbus.BusObject, path string) (ret []float64, err error) { - variant, err := object.GetProperty(path) - if err != nil { - return nil, err - } - for _, v := range variant.Value().([]interface{}) { - i := v.(uint64) - ret = append(ret, float64(i)) - } - return ret, err -} - func (c *Collector) collect(ch chan<- prometheus.Metric) error { begin := time.Now() conn, err := c.newDbus() @@ -295,7 +282,6 @@ func (c *Collector) collect(ch chan<- prometheus.Metric) error { } wg.Wait() - return nil }