硬盘TRIM增加追踪统计

This commit is contained in:
刘祥超
2024-04-18 15:10:08 +08:00
parent 0065543e96
commit ad558cc0e8

View File

@@ -5,6 +5,7 @@ package nodes
import ( import (
"fmt" "fmt"
"github.com/TeaOSLab/EdgeNode/internal/remotelogs" "github.com/TeaOSLab/EdgeNode/internal/remotelogs"
"github.com/TeaOSLab/EdgeNode/internal/trackers"
executils "github.com/TeaOSLab/EdgeNode/internal/utils/exec" executils "github.com/TeaOSLab/EdgeNode/internal/utils/exec"
"github.com/TeaOSLab/EdgeNode/internal/utils/idles" "github.com/TeaOSLab/EdgeNode/internal/utils/idles"
"runtime" "runtime"
@@ -57,6 +58,8 @@ func (this *TrimDisksTask) loop() error {
return fmt.Errorf("'fstrim' command not found: %w", err) return fmt.Errorf("'fstrim' command not found: %w", err)
} }
defer trackers.Begin("TRIM_DISKS").End()
var cmd = executils.NewCmd(trimExe, "-a"). var cmd = executils.NewCmd(trimExe, "-a").
WithStderr() WithStderr()
err = cmd.Run() err = cmd.Run()