collector: add openbsd support to interrupt collector
This commit is contained in:
parent
14078251c5
commit
73ee8f5257
3 changed files with 197 additions and 22 deletions
|
|
@ -27,28 +27,9 @@ import (
|
|||
"github.com/prometheus/client_golang/prometheus"
|
||||
)
|
||||
|
||||
type interruptsCollector struct {
|
||||
metric *prometheus.CounterVec
|
||||
}
|
||||
|
||||
func init() {
|
||||
Factories["interrupts"] = NewInterruptsCollector
|
||||
}
|
||||
|
||||
// Takes a prometheus registry and returns a new Collector exposing
|
||||
// interrupts stats
|
||||
func NewInterruptsCollector() (Collector, error) {
|
||||
return &interruptsCollector{
|
||||
metric: prometheus.NewCounterVec(
|
||||
prometheus.CounterOpts{
|
||||
Namespace: Namespace,
|
||||
Name: "interrupts",
|
||||
Help: "Interrupt details.",
|
||||
},
|
||||
[]string{"CPU", "type", "info", "devices"},
|
||||
),
|
||||
}, nil
|
||||
}
|
||||
var (
|
||||
interruptLabelNames = []string{"CPU", "type", "info", "devices"}
|
||||
)
|
||||
|
||||
func (c *interruptsCollector) Update(ch chan<- prometheus.Metric) (err error) {
|
||||
interrupts, err := getInterrupts()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue