我相信信息流是:
cf CLI< - >云控制器< - > DEA< - > Warden< - > cgroup CPU Accounting
看到:
此处的统计信息显示了容器在最后一秒CPU(VM)中花费的时间进程百分比。如果您的应用程序要执行更多CPU密集型操作,您可能会看到此数字增加。例如,我推了一个小的hello-world Golang应用程序,它在后台运行一个紧密的循环,它计算一些随机浮点数的正弦值,然后
cf app
显示15.5%的CPU使用率:
package main
import (
“fmt”
“net/http”
“os”
“math”
“math/rand”
)
func main() {
go func() {
for {
println(math.Sin(rand.Float64()))
}
}()
http.HandleFunc("/", hello)
fmt.Println("listening...")
err := http.ListenAndServe(":"+os.Getenv("PORT"), nil)
if err != nil {
panic(err)
}
}
func hello(res http.ResponseWriter, req *http.Request) {
fmt.Fprintln(res, “go, world”)
}
</code>