Fix wrong metric types in system collector, improve help-strings

This commit is contained in:
Calle Pettersson 2018-04-29 17:14:53 +02:00
parent 4b3d1d60d9
commit 0ab6c191be
1 changed files with 9 additions and 9 deletions

View File

@ -30,37 +30,37 @@ func NewSystemCollector() (Collector, error) {
return &SystemCollector{
ContextSwitchesTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "context_switches_total"),
"PerfOS_System.ContextSwitchesPersec",
"Total number of context switches (WMI source: PerfOS_System.ContextSwitchesPersec)",
nil,
nil,
),
ExceptionDispatchesTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "exception_dispatches_total"),
"PerfOS_System.ExceptionDispatchesPersec",
"Total number of exceptions dispatched (WMI source: PerfOS_System.ExceptionDispatchesPersec)",
nil,
nil,
),
ProcessorQueueLength: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "processor_queue_length"),
"PerfOS_System.ProcessorQueueLength",
"Length of processor queue (WMI source: PerfOS_System.ProcessorQueueLength)",
nil,
nil,
),
SystemCallsTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "system_calls_total"),
"PerfOS_System.SystemCallsPersec",
"Total number of system calls (WMI source: PerfOS_System.SystemCallsPersec)",
nil,
nil,
),
SystemUpTime: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "system_up_time"),
"SystemUpTime/Frequency_Object",
"System boot time (WMI source: PerfOS_System.SystemUpTime)",
nil,
nil,
),
Threads: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "threads"),
"PerfOS_System.Threads",
"Current number of threads (WMI source: PerfOS_System.Threads)",
nil,
nil,
),
@ -96,12 +96,12 @@ func (c *SystemCollector) collect(ch chan<- prometheus.Metric) (*prometheus.Desc
ch <- prometheus.MustNewConstMetric(
c.ContextSwitchesTotal,
prometheus.GaugeValue,
prometheus.CounterValue,
float64(dst[0].ContextSwitchesPersec),
)
ch <- prometheus.MustNewConstMetric(
c.ExceptionDispatchesTotal,
prometheus.GaugeValue,
prometheus.CounterValue,
float64(dst[0].ExceptionDispatchesPersec),
)
ch <- prometheus.MustNewConstMetric(
@ -111,7 +111,7 @@ func (c *SystemCollector) collect(ch chan<- prometheus.Metric) (*prometheus.Desc
)
ch <- prometheus.MustNewConstMetric(
c.SystemCallsTotal,
prometheus.GaugeValue,
prometheus.CounterValue,
float64(dst[0].SystemCallsPersec),
)
ch <- prometheus.MustNewConstMetric(