From 46b38dd0a1e5852bd3d9b7f77e7fba1d615e694c Mon Sep 17 00:00:00 2001 From: spiritlhl <103393591+spiritLHLS@users.noreply.github.com> Date: Tue, 30 Jul 2024 09:59:57 +0000 Subject: [PATCH] update --- disk/utils.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/disk/utils.go b/disk/utils.go index f4b69e4..e6fdddd 100644 --- a/disk/utils.go +++ b/disk/utils.go @@ -100,9 +100,15 @@ func parseResultDD(tempText, blockCount string) string { var records, usageTime float64 records, _ = strconv.ParseFloat(blockCount, 64) for _, t := range tp1 { - if strings.Contains(t, "bytes") { + if strings.Contains(t, "bytes") || strings.Contains(t, "字节") { + var tp2 []string + if strings.Contains(t, "bytes") { + tp2 = strings.Split(t, ",") + } else { + tp2 = strings.Split(t, ",") + } // t 为 104857600 bytes (105 MB, 100 MiB) copied, 4.67162 s, 22.4 MB/s - tp2 := strings.Split(t, ",") + // t 为 104857600字节(105 MB,100 MiB)已复制,0.0569789 s,1.8 GB/s if len(tp2) == 4 { usageTime, _ = strconv.ParseFloat(strings.Split(strings.TrimSpace(tp2[2]), " ")[0], 64) ioSpeed := strings.Split(strings.TrimSpace(tp2[3]), " ")[0]