Issue 706: Fix time unit

pull/725/head
Pablo Garcia 4 weeks ago
parent 0641b5e79d
commit 85d98316f3
No known key found for this signature in database
GPG Key ID: 13C15C3A8E6AB87D

@ -4,6 +4,12 @@ import (
"bytes" "bytes"
"encoding/json" "encoding/json"
"fmt" "fmt"
"net/url"
"os"
"os/exec"
"strings"
"time"
"github.com/analogj/scrutiny/collector/pkg/common/shell" "github.com/analogj/scrutiny/collector/pkg/common/shell"
"github.com/analogj/scrutiny/collector/pkg/config" "github.com/analogj/scrutiny/collector/pkg/config"
"github.com/analogj/scrutiny/collector/pkg/detect" "github.com/analogj/scrutiny/collector/pkg/detect"
@ -11,11 +17,6 @@ import (
"github.com/analogj/scrutiny/collector/pkg/models" "github.com/analogj/scrutiny/collector/pkg/models"
"github.com/samber/lo" "github.com/samber/lo"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"net/url"
"os"
"os/exec"
"strings"
"time"
) )
type MetricsCollector struct { type MetricsCollector struct {
@ -92,7 +93,7 @@ func (mc *MetricsCollector) Run() error {
mc.Collect(device.WWN, device.DeviceName, device.DeviceType) mc.Collect(device.WWN, device.DeviceName, device.DeviceType)
if mc.config.GetInt("commands.metrics_smartctl_wait") > 0 { 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)
} }
} }
@ -115,7 +116,7 @@ func (mc *MetricsCollector) Validate() error {
return nil 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) { func (mc *MetricsCollector) Collect(deviceWWN string, deviceName string, deviceType string) {
//defer wg.Done() //defer wg.Done()
if len(deviceWWN) == 0 { if len(deviceWWN) == 0 {

Loading…
Cancel
Save