diff --git a/cmd/edge-node/main.go b/cmd/edge-node/main.go index d3fb630..798157b 100644 --- a/cmd/edge-node/main.go +++ b/cmd/edge-node/main.go @@ -436,7 +436,7 @@ func main() { if err != nil { fmt.Println("[ERROR]" + err.Error()) } else { - fmt.Printf("Speed: %.2fMB/s\n", speedMB) + fmt.Printf("Speed: %.0fMB/s\n", speedMB) if isFast { fmt.Println("IsFast: true") } else { diff --git a/internal/utils/fs/disk.go b/internal/utils/fs/disk.go index 3d24551..89a8549 100644 --- a/internal/utils/fs/disk.go +++ b/internal/utils/fs/disk.go @@ -4,6 +4,7 @@ package fsutils import ( "bytes" + "math" "os" "time" ) @@ -52,6 +53,7 @@ func CheckDiskWritingSpeed() (speedMB float64, err error) { var costSeconds = time.Since(before).Seconds() speedMB = float64(len(data)) / (1 << 20) / costSeconds + speedMB = math.Ceil(speedMB/10) * 10 isClosed = true