Update Makefile.common (#1220)
* Update Makefile.common Update to new staticcheck method[0]. [0]: https://github.com/prometheus/prometheus/pull/5057 Signed-off-by: Ben Kochie <superq@gmail.com> * Fix staticcheck errors. Signed-off-by: Ben Kochie <superq@gmail.com>
This commit is contained in:
parent
085d872aaf
commit
070e4b2e17
5 changed files with 35 additions and 33 deletions
|
|
@ -68,7 +68,7 @@ func NewNtpCollector() (Collector, error) {
|
|||
}
|
||||
|
||||
if *ntpOffsetTolerance < 0 {
|
||||
return nil, fmt.Errorf("Offset tolerance must be non-negative")
|
||||
return nil, fmt.Errorf("offset tolerance must be non-negative")
|
||||
}
|
||||
|
||||
return &ntpCollector{
|
||||
|
|
|
|||
|
|
@ -76,14 +76,14 @@ func NewSupervisordCollector() (Collector, error) {
|
|||
func (c *supervisordCollector) isRunning(state int) bool {
|
||||
// http://supervisord.org/subprocess.html#process-states
|
||||
const (
|
||||
STOPPED = 0
|
||||
// STOPPED = 0
|
||||
STARTING = 10
|
||||
RUNNING = 20
|
||||
BACKOFF = 30
|
||||
// BACKOFF = 30
|
||||
STOPPING = 40
|
||||
EXITED = 100
|
||||
FATAL = 200
|
||||
UNKNOWN = 1000
|
||||
// EXITED = 100
|
||||
// FATAL = 200
|
||||
// UNKNOWN = 1000
|
||||
)
|
||||
switch state {
|
||||
case STARTING, RUNNING, STOPPING:
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ func convertMetricFamily(metricFamily *dto.MetricFamily, ch chan<- prometheus.Me
|
|||
break
|
||||
}
|
||||
}
|
||||
if present == false {
|
||||
if !present {
|
||||
names = append(names, k)
|
||||
values = append(values, "")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,14 +29,14 @@ import (
|
|||
// constants from https://github.com/zfsonlinux/zfs/blob/master/lib/libspl/include/sys/kstat.h
|
||||
// kept as strings for comparison thus avoiding conversion to int
|
||||
const (
|
||||
kstatDataChar = "0"
|
||||
kstatDataInt32 = "1"
|
||||
kstatDataUint32 = "2"
|
||||
kstatDataInt64 = "3"
|
||||
// kstatDataChar = "0"
|
||||
// kstatDataInt32 = "1"
|
||||
// kstatDataUint32 = "2"
|
||||
// kstatDataInt64 = "3"
|
||||
kstatDataUint64 = "4"
|
||||
kstatDataLong = "5"
|
||||
kstatDataUlong = "6"
|
||||
kstatDataString = "7"
|
||||
// kstatDataLong = "5"
|
||||
// kstatDataUlong = "6"
|
||||
// kstatDataString = "7"
|
||||
)
|
||||
|
||||
func (c *zfsCollector) openProcFile(path string) (*os.File, error) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue