代码拉取完成,页面将自动刷新
package main
import (
"net/http"
"time"
"gitee.com/menciis/gkit/watching"
)
func init() {
http.HandleFunc("/docker", dockermake1gb)
http.HandleFunc("/docker/cpu", cpuex)
http.HandleFunc("/docker/cpu_multi_core", cpuMulticore)
go http.ListenAndServe(":10003", nil)
}
func main() {
w := watching.NewWatching(
watching.WithCollectInterval("2s"),
watching.WithCoolDown("1m"),
watching.WithDumpPath("/tmp"),
watching.WithTextDump(),
watching.WithLoggerLevel(watching.LogLevelDebug),
watching.WithMemDump(3, 25, 80),
watching.WithCPUDump(60, 10, 80),
watching.WithCGroup(true),
)
w.EnableCPUDump()
w.EnableMemDump()
w.Start()
time.Sleep(time.Hour)
}
func cpuex(wr http.ResponseWriter, req *http.Request) {
go func() {
for {
}
}()
}
func cpuMulticore(wr http.ResponseWriter, req *http.Request) {
for i := 1; i <= 100; i++ {
go func() {
for {
}
}()
}
}
func dockermake1gb(wr http.ResponseWriter, req *http.Request) {
a := make([]byte, 1073741824)
_ = a
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。