From 4fdc04368a61ffc298d58b95f565b9fb8a10d1ce Mon Sep 17 00:00:00 2001 From: "lilong.129" Date: Sun, 13 Aug 2023 11:47:53 +0800 Subject: [PATCH] change: logs --- hrp/pkg/uixt/action.go | 8 ++++---- hrp/pkg/uixt/video_crawler.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hrp/pkg/uixt/action.go b/hrp/pkg/uixt/action.go index 68db7792..0d8b593f 100644 --- a/hrp/pkg/uixt/action.go +++ b/hrp/pkg/uixt/action.go @@ -629,10 +629,10 @@ func getSimulationDuration(params []interface{}) (milliseconds int64) { for _, s := range sections { accProb += s.weight / totalProb if r < accProb { - seconds := s.min + rand.Float64()*(s.max-s.min) - log.Info().Float64("randomSeconds", seconds). + milliseconds := int64((s.min + rand.Float64()*(s.max-s.min)) * 1000) + log.Info().Int64("random(ms)", milliseconds). Interface("strategy_params", params).Msg("get simulation duration") - return int64(seconds * 1000) + return milliseconds } } @@ -649,7 +649,7 @@ func sleepStrict(startTime time.Time, strictMilliseconds int64) { // if elapsed time is greater than given duration, skip sleep to reduce deviation caused by process time if dur <= 0 { - log.Info(). + log.Warn(). Int64("elapsed(ms)", elapsed). Int64("strictSleep(ms)", strictMilliseconds). Msg("elapsed >= simulation duration, skip sleep") diff --git a/hrp/pkg/uixt/video_crawler.go b/hrp/pkg/uixt/video_crawler.go index 6a68a9e7..659b9ab8 100644 --- a/hrp/pkg/uixt/video_crawler.go +++ b/hrp/pkg/uixt/video_crawler.go @@ -404,7 +404,7 @@ func (dExt *DriverExt) VideoCrawler(configs *VideoCrawlerConfigs) (err error) { // check feed type and incr feed count err := currVideoStat.incrFeed(screenResult, dExt) if err != nil { - log.Error().Err(err).Msg("incr feed failed") + log.Warn().Err(err).Msg("incr feed failed") } else { // simulation watch feed video sleepStrict(lastSwipeTime, screenResult.Feed.PlayDuration)