switch to go-kit/log (#1575)
Signed-off-by: yeya24 <yb532204897@gmail.com>
This commit is contained in:
parent
a80b7d0bc5
commit
2477c5c67d
158 changed files with 3434 additions and 4636 deletions
|
|
@ -20,6 +20,7 @@ import (
|
|||
"fmt"
|
||||
"strconv"
|
||||
|
||||
"github.com/go-kit/kit/log"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
kstat "github.com/siebenmann/go-kstat"
|
||||
)
|
||||
|
|
@ -30,13 +31,14 @@ import "C"
|
|||
type cpuFreqCollector struct {
|
||||
cpuFreq *prometheus.Desc
|
||||
cpuFreqMax *prometheus.Desc
|
||||
logger log.Logger
|
||||
}
|
||||
|
||||
func init() {
|
||||
registerCollector("cpufreq", defaultEnabled, NewCpuFreqCollector)
|
||||
}
|
||||
|
||||
func NewFreqCpuCollector() (Collector, error) {
|
||||
func NewFreqCpuCollector(logger log.Logger) (Collector, error) {
|
||||
return &cpuFreqCollector{
|
||||
cpuFreq: prometheus.NewDesc(
|
||||
prometheus.BuildFQName(namespace, cpuCollectorSubsystem, "frequency_hertz"),
|
||||
|
|
@ -48,6 +50,7 @@ func NewFreqCpuCollector() (Collector, error) {
|
|||
"Maximum cpu thread frequency in hertz.",
|
||||
[]string{"cpu"}, nil,
|
||||
),
|
||||
logger: logger,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue