From 4f165f3b2718450d050c726c81c535406705982a Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Wed, 18 May 2022 21:58:32 +0800 Subject: [PATCH] statistic update --- pkg/statistics/statistics.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/statistics/statistics.go b/pkg/statistics/statistics.go index 50d6a2814..63653c42f 100644 --- a/pkg/statistics/statistics.go +++ b/pkg/statistics/statistics.go @@ -9,7 +9,7 @@ type Statistics struct { AllCount *uint64 ModuleName string PrintArgs string - SleepTime int + SleepTime uint64 } func (s *Statistics) output() { @@ -29,12 +29,12 @@ func (s *Statistics) output() { intervalCount = *s.AllCount - sum } timeIntervalNum++ - log.NewWarn("", " system stat ", s.ModuleName, s.PrintArgs, intervalCount, "total:", *s.AllCount, "intervalNum", timeIntervalNum) + log.NewWarn("", " system stat ", s.ModuleName, s.PrintArgs, intervalCount, "total:", *s.AllCount, "intervalNum", timeIntervalNum, "avg", (*s.AllCount)/(timeIntervalNum)/s.SleepTime) } } func NewStatistics(allCount *uint64, moduleName, printArgs string, sleepTime int) *Statistics { - p := &Statistics{AllCount: allCount, ModuleName: moduleName, SleepTime: sleepTime, PrintArgs: printArgs} + p := &Statistics{AllCount: allCount, ModuleName: moduleName, SleepTime: uint64(sleepTime), PrintArgs: printArgs} go p.output() return p }