Skip to content

Commit

Permalink
Merge pull request #195 from martinlindhe/totals-as-gauges-help-string
Browse files Browse the repository at this point in the history
Fix wrong metric types in system collector, improve help-strings
  • Loading branch information
carlpett authored Apr 30, 2018
2 parents c9fc76d + 0ab6c19 commit a0333ee
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions collector/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
Expand Down Expand Up @@ -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(
Expand All @@ -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(
Expand Down

0 comments on commit a0333ee

Please sign in to comment.