Counter metrics should be exposed as rather than
This commit is contained in:
parent
23d92cfcae
commit
e25e96a62e
|
@ -148,50 +148,50 @@ func (c *CPUCollector) collect(ch chan<- prometheus.Metric) (*prometheus.Desc, e
|
||||||
|
|
||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
c.CStateSecondsTotal,
|
c.CStateSecondsTotal,
|
||||||
prometheus.GaugeValue,
|
prometheus.CounterValue,
|
||||||
float64(data.PercentC1Time)*ticksToSecondsScaleFactor,
|
float64(data.PercentC1Time)*ticksToSecondsScaleFactor,
|
||||||
core, "c1",
|
core, "c1",
|
||||||
)
|
)
|
||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
c.CStateSecondsTotal,
|
c.CStateSecondsTotal,
|
||||||
prometheus.GaugeValue,
|
prometheus.CounterValue,
|
||||||
float64(data.PercentC2Time)*ticksToSecondsScaleFactor,
|
float64(data.PercentC2Time)*ticksToSecondsScaleFactor,
|
||||||
core, "c2",
|
core, "c2",
|
||||||
)
|
)
|
||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
c.CStateSecondsTotal,
|
c.CStateSecondsTotal,
|
||||||
prometheus.GaugeValue,
|
prometheus.CounterValue,
|
||||||
float64(data.PercentC3Time)*ticksToSecondsScaleFactor,
|
float64(data.PercentC3Time)*ticksToSecondsScaleFactor,
|
||||||
core, "c3",
|
core, "c3",
|
||||||
)
|
)
|
||||||
|
|
||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
c.TimeTotal,
|
c.TimeTotal,
|
||||||
prometheus.GaugeValue,
|
prometheus.CounterValue,
|
||||||
float64(data.PercentIdleTime)*ticksToSecondsScaleFactor,
|
float64(data.PercentIdleTime)*ticksToSecondsScaleFactor,
|
||||||
core, "idle",
|
core, "idle",
|
||||||
)
|
)
|
||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
c.TimeTotal,
|
c.TimeTotal,
|
||||||
prometheus.GaugeValue,
|
prometheus.CounterValue,
|
||||||
float64(data.PercentInterruptTime)*ticksToSecondsScaleFactor,
|
float64(data.PercentInterruptTime)*ticksToSecondsScaleFactor,
|
||||||
core, "interrupt",
|
core, "interrupt",
|
||||||
)
|
)
|
||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
c.TimeTotal,
|
c.TimeTotal,
|
||||||
prometheus.GaugeValue,
|
prometheus.CounterValue,
|
||||||
float64(data.PercentDPCTime)*ticksToSecondsScaleFactor,
|
float64(data.PercentDPCTime)*ticksToSecondsScaleFactor,
|
||||||
core, "dpc",
|
core, "dpc",
|
||||||
)
|
)
|
||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
c.TimeTotal,
|
c.TimeTotal,
|
||||||
prometheus.GaugeValue,
|
prometheus.CounterValue,
|
||||||
float64(data.PercentPrivilegedTime)*ticksToSecondsScaleFactor,
|
float64(data.PercentPrivilegedTime)*ticksToSecondsScaleFactor,
|
||||||
core, "privileged",
|
core, "privileged",
|
||||||
)
|
)
|
||||||
ch <- prometheus.MustNewConstMetric(
|
ch <- prometheus.MustNewConstMetric(
|
||||||
c.TimeTotal,
|
c.TimeTotal,
|
||||||
prometheus.GaugeValue,
|
prometheus.CounterValue,
|
||||||
float64(data.PercentUserTime)*ticksToSecondsScaleFactor,
|
float64(data.PercentUserTime)*ticksToSecondsScaleFactor,
|
||||||
core, "user",
|
core, "user",
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue