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
|
|
@ -18,6 +18,7 @@ package collector
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/go-kit/kit/log"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"github.com/prometheus/procfs/bcache"
|
||||
)
|
||||
|
|
@ -28,19 +29,21 @@ func init() {
|
|||
|
||||
// A bcacheCollector is a Collector which gathers metrics from Linux bcache.
|
||||
type bcacheCollector struct {
|
||||
fs bcache.FS
|
||||
fs bcache.FS
|
||||
logger log.Logger
|
||||
}
|
||||
|
||||
// NewBcacheCollector returns a newly allocated bcacheCollector.
|
||||
// It exposes a number of Linux bcache statistics.
|
||||
func NewBcacheCollector() (Collector, error) {
|
||||
func NewBcacheCollector(logger log.Logger) (Collector, error) {
|
||||
fs, err := bcache.NewFS(*sysPath)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to open sysfs: %w", err)
|
||||
}
|
||||
|
||||
return &bcacheCollector{
|
||||
fs: fs,
|
||||
fs: fs,
|
||||
logger: logger,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue