Skip to content

Commit

Permalink
Issue 706: Fix time unit
Browse files Browse the repository at this point in the history
  • Loading branch information
pabsi committed Nov 26, 2024
1 parent 0641b5e commit 85d9831
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions collector/pkg/collector/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,19 @@ import (
"bytes"
"encoding/json"
"fmt"
"net/url"
"os"
"os/exec"
"strings"
"time"

"github.com/analogj/scrutiny/collector/pkg/common/shell"
"github.com/analogj/scrutiny/collector/pkg/config"
"github.com/analogj/scrutiny/collector/pkg/detect"
"github.com/analogj/scrutiny/collector/pkg/errors"
"github.com/analogj/scrutiny/collector/pkg/models"
"github.com/samber/lo"
"github.com/sirupsen/logrus"
"net/url"
"os"
"os/exec"
"strings"
"time"
)

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

if mc.config.GetInt("commands.metrics_smartctl_wait") > 0 {
time.Sleep(time.Duration(mc.config.GetInt("commands.metrics_smartctl_wait")) * time.Millisecond)
time.Sleep(time.Duration(mc.config.GetInt("commands.metrics_smartctl_wait")) * 1000 * time.Millisecond)
}
}

Expand All @@ -115,7 +116,7 @@ func (mc *MetricsCollector) Validate() error {
return nil
}

//func (mc *MetricsCollector) Collect(wg *sync.WaitGroup, deviceWWN string, deviceName string, deviceType string) {
// func (mc *MetricsCollector) Collect(wg *sync.WaitGroup, deviceWWN string, deviceName string, deviceType string) {
func (mc *MetricsCollector) Collect(deviceWWN string, deviceName string, deviceType string) {
//defer wg.Done()
if len(deviceWWN) == 0 {
Expand Down

0 comments on commit 85d9831

Please sign in to comment.