From 12ae4d1a2e87b82467c674b55df3df1384b813ec Mon Sep 17 00:00:00 2001 From: yedf2 <120050102@qq.com> Date: Thu, 29 Sep 2022 14:27:07 +0800 Subject: [PATCH] fix memory increasing --- dtmsvr/metrics.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dtmsvr/metrics.go b/dtmsvr/metrics.go index 88b10d8..621eee4 100644 --- a/dtmsvr/metrics.go +++ b/dtmsvr/metrics.go @@ -94,18 +94,18 @@ func grpcMetrics(ctx context.Context, req interface{}, info *grpc.UnaryServerInf func transactionMetrics(global *TransGlobal, status bool) { if status { - transactionTotal.WithLabelValues(global.TransType, global.Gid, "ok").Inc() + transactionTotal.WithLabelValues(global.TransType, "ok").Inc() } else { - transactionTotal.WithLabelValues(global.TransType, global.Gid, "fail").Inc() + transactionTotal.WithLabelValues(global.TransType, "fail").Inc() } - transactionHandledTime.WithLabelValues(global.TransType, global.Gid).Observe(time.Since(*global.CreateTime).Seconds()) + transactionHandledTime.WithLabelValues(global.TransType).Observe(time.Since(*global.CreateTime).Seconds()) } func branchMetrics(global *TransGlobal, branch *TransBranch, status bool) { if status { - branchTotal.WithLabelValues(global.TransType, global.Gid, branch.BranchID, branch.Op, "ok").Inc() + branchTotal.WithLabelValues(global.TransType, branch.BranchID, branch.Op, "ok").Inc() } else { - branchTotal.WithLabelValues(global.TransType, global.Gid, branch.BranchID, branch.Op, "fail").Inc() + branchTotal.WithLabelValues(global.TransType, branch.BranchID, branch.Op, "fail").Inc() } }