From 5a7cfaeeaa881201badaa86db4868c908d64223a Mon Sep 17 00:00:00 2001 From: qydysky Date: Sat, 25 Nov 2023 20:17:27 +0800 Subject: [PATCH] =?utf8?q?Improve=20=E4=BC=98=E5=8C=96=E6=80=A7=E8=83=BD?= =?utf8?q?=E5=93=8D=E5=BA=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- CV/Var.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CV/Var.go b/CV/Var.go index e3fc12a..7591ee4 100644 --- a/CV/Var.go +++ b/CV/Var.go @@ -8,6 +8,7 @@ import ( "flag" "fmt" "io" + "math" "net/http" "net/url" "os" @@ -255,12 +256,18 @@ func (t *Common) Init() *Common { t.ReqPool = pool.New( func() *reqf.Req { + // if pc, file, line, ok := runtime.Caller(2); ok { + // fmt.Printf("call by %s\n\t%s:%d\n", runtime.FuncForPC(pc).Name(), file, line) + // } return reqf.New() }, func(t *reqf.Req) bool { return t.IsLive() }, func(t *reqf.Req) *reqf.Req { + // if pc, file, line, ok := runtime.Caller(2); ok { + // fmt.Printf("call by %s\n\t%s:%d\n", runtime.FuncForPC(pc).Name(), file, line) + // } return t }, func(t *reqf.Req) *reqf.Req { @@ -387,7 +394,7 @@ func (t *Common) Init() *Common { "inuse": reqState[2], "nouse": reqState[3], "sum": reqState[4], - "qts": reqState[5], + "qts": math.Round(reqState[5].(float64)*100) / 100, }, "numGoroutine": runtime.NumGoroutine(), "goVersion": runtime.Version(), -- 2.39.2