-
Notifications
You must be signed in to change notification settings - Fork 3
/
os_info_notwindows.go
35 lines (31 loc) · 1.08 KB
/
os_info_notwindows.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//go:build !windows
package logrusKit
import (
"github.com/richelieu-yang/chimera/v3/src/core/osKit"
"github.com/sirupsen/logrus"
)
// printUniqueOsInfo 输出特殊的信息(主要依赖于不同的OS)
func printUniqueOsInfo() {
if str, err := osKit.GetUlimitInfo(); err != nil {
logrus.WithError(err).Warn("[CHIMERA, OS] fail to get ulimit information")
} else {
DisableQuoteTemporarily(nil, func(logger *logrus.Logger) {
logger.Infof("[CHIMERA, OS] ulimit information:\n%s\n", str)
})
}
if i, err := osKit.GetThreadsMax(); err != nil {
logrus.WithError(err).Warn("[CHIMERA, OS] fail to get kernel.threads-max")
} else {
logrus.Infof("[CHIMERA, OS] kernel.threads-max: [%d].", i)
}
if i, err := osKit.GetPidMax(); err != nil {
logrus.WithError(err).Warn("[CHIMERA, OS] fail to get kernel.pid_max")
} else {
logrus.Infof("[CHIMERA, OS] kernel.pid_max: [%d].", i)
}
if i, err := osKit.GetMaxMapCount(); err != nil {
logrus.WithError(err).Warn("[CHIMERA, OS] fail to get vm.max_map_count")
} else {
logrus.Infof("[CHIMERA, OS] vm.max_map_count: [%d].", i)
}
}