Skip to content

Commit

Permalink
remove unused function
Browse files Browse the repository at this point in the history
Signed-off-by: egmc <[email protected]>
  • Loading branch information
egmc committed Jan 6, 2024
1 parent eafbe41 commit e144b1f
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions systemd/systemd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -245,25 +243,14 @@ func (c *Collector) Describe(desc chan<- *prometheus.Desc) {
desc <- c.ipEgressBytes
desc <- c.ipIngressPackets
desc <- c.ipEgressPackets

}

func parseUnitType(unit dbus.UnitStatus) string {
t := strings.Split(unit.Name, ".")
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()
Expand Down Expand Up @@ -295,7 +282,6 @@ func (c *Collector) collect(ch chan<- prometheus.Metric) error {
}

wg.Wait()

return nil
}

Expand Down

0 comments on commit e144b1f

Please sign in to comment.