Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions collector/fixtures/e2e-output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2606,12 +2606,9 @@ node_qdisc_packets_total{device="wlan0",kind="fq"} 42
# TYPE node_qdisc_requeues_total counter
node_qdisc_requeues_total{device="eth0",kind="pfifo_fast"} 2
node_qdisc_requeues_total{device="wlan0",kind="fq"} 1
# HELP node_rapl_core_joules_total Current RAPL core value in joules
# TYPE node_rapl_core_joules_total counter
node_rapl_core_joules_total{index="0"} 118821.284256
# HELP node_rapl_package_joules_total Current RAPL package value in joules
# TYPE node_rapl_package_joules_total counter
node_rapl_package_joules_total{index="0"} 240422.366267
# HELP node_rapl_joules_total Current RAPL package value in joules
# TYPE node_rapl_joules_total counter
node_rapl_joules_total{index="0",name="package"} 240422.366267
# HELP node_schedstat_running_seconds_total Number of seconds CPU spent running a process.
# TYPE node_schedstat_running_seconds_total counter
node_schedstat_running_seconds_total{cpu="0"} 2.045936778163039e+06
Expand Down
8 changes: 4 additions & 4 deletions collector/rapl_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@
package collector

import (
"strconv"

"github.com/go-kit/kit/log"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/procfs/sysfs"
"strconv"
)

type raplCollector struct {
Expand Down Expand Up @@ -61,15 +60,16 @@ func (c *raplCollector) Update(ch chan<- prometheus.Metric) error {
index := strconv.Itoa(rz.Index)

descriptor := prometheus.NewDesc(
prometheus.BuildFQName(namespace, "rapl", rz.Name+"_joules_total"),
prometheus.BuildFQName(namespace, "rapl", "joules_total"),
"Current RAPL "+rz.Name+" value in joules",
[]string{"index"}, nil,
[]string{"name", "index"}, nil,
)

ch <- prometheus.MustNewConstMetric(
descriptor,
prometheus.CounterValue,
float64(newMicrojoules)/1000000.0,
rz.Name,
index,
)
}
Expand Down