Skip to content

Commit affe05e

Browse files
authored
Merge pull request AnalogJ#725 from pabsi/706-add-wait-time-between-checks-fix-unit
Issue 706: Fix time unit
2 parents 0641b5e + 9ad96e6 commit affe05e

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

collector/pkg/collector/metrics.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,19 @@ import (
44
"bytes"
55
"encoding/json"
66
"fmt"
7+
"net/url"
8+
"os"
9+
"os/exec"
10+
"strings"
11+
"time"
12+
713
"github.com/analogj/scrutiny/collector/pkg/common/shell"
814
"github.com/analogj/scrutiny/collector/pkg/config"
915
"github.com/analogj/scrutiny/collector/pkg/detect"
1016
"github.com/analogj/scrutiny/collector/pkg/errors"
1117
"github.com/analogj/scrutiny/collector/pkg/models"
1218
"github.com/samber/lo"
1319
"github.com/sirupsen/logrus"
14-
"net/url"
15-
"os"
16-
"os/exec"
17-
"strings"
18-
"time"
1920
)
2021

2122
type MetricsCollector struct {
@@ -92,7 +93,7 @@ func (mc *MetricsCollector) Run() error {
9293
mc.Collect(device.WWN, device.DeviceName, device.DeviceType)
9394

9495
if mc.config.GetInt("commands.metrics_smartctl_wait") > 0 {
95-
time.Sleep(time.Duration(mc.config.GetInt("commands.metrics_smartctl_wait")) * time.Millisecond)
96+
time.Sleep(time.Duration(mc.config.GetInt("commands.metrics_smartctl_wait")) * time.Second)
9697
}
9798
}
9899

@@ -115,7 +116,7 @@ func (mc *MetricsCollector) Validate() error {
115116
return nil
116117
}
117118

118-
//func (mc *MetricsCollector) Collect(wg *sync.WaitGroup, deviceWWN string, deviceName string, deviceType string) {
119+
// func (mc *MetricsCollector) Collect(wg *sync.WaitGroup, deviceWWN string, deviceName string, deviceType string) {
119120
func (mc *MetricsCollector) Collect(deviceWWN string, deviceName string, deviceType string) {
120121
//defer wg.Done()
121122
if len(deviceWWN) == 0 {

0 commit comments

Comments
 (0)