mirror of
https://github.com/oneclickvirt/basics.git
synced 2025-10-06 09:07:10 +08:00
update
This commit is contained in:
44
system/utils/utils_linux.go
Normal file
44
system/utils/utils_linux.go
Normal file
@@ -0,0 +1,44 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"os/exec"
|
||||
"time"
|
||||
)
|
||||
|
||||
// GetCpuCache 查询CPU三缓
|
||||
func GetCpuCache() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func CheckCPUFeatureWindows(subkey string, value string) (string, bool) {
|
||||
return "", false
|
||||
}
|
||||
|
||||
func CheckVMTypeWithWIMC() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func GetLoad1() float64 {
|
||||
return 0
|
||||
}
|
||||
|
||||
// GetTCPAccelerateStatus 查询TCP控制算法
|
||||
func GetTCPAccelerateStatus() string {
|
||||
cmd := exec.Command("sysctl", "-n", "net.ipv4.tcp_congestion_control")
|
||||
var out bytes.Buffer
|
||||
cmd.Stdout = &out
|
||||
err := cmd.Run()
|
||||
if err != nil {
|
||||
return ""
|
||||
} else {
|
||||
return out.String()
|
||||
}
|
||||
}
|
||||
|
||||
// GetTimeZone 获取当前时区
|
||||
func GetTimeZone() string {
|
||||
local := time.Now().Location()
|
||||
CurrentTimeZone := local.String()
|
||||
return CurrentTimeZone
|
||||
}
|
Reference in New Issue
Block a user