From c5c7224c51842dcd767f49d3c381fb4dcd67a313 Mon Sep 17 00:00:00 2001 From: nick Date: Tue, 30 Jul 2024 17:20:25 +0900 Subject: [PATCH] feat: print log --- node/pkg/dal/collector/collector.go | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/node/pkg/dal/collector/collector.go b/node/pkg/dal/collector/collector.go index e99fd91f6..16d2f4819 100644 --- a/node/pkg/dal/collector/collector.go +++ b/node/pkg/dal/collector/collector.go @@ -159,21 +159,12 @@ func (c *Collector) receiveEach(ctx context.Context, configId int32) error { func (c *Collector) processIncomingData(ctx context.Context, data aggregator.SubmissionData) { symbol := c.Symbols[data.GlobalAggregate.ConfigID] - diff := time.Since(data.GlobalAggregate.Timestamp).Seconds() - if diff > 3 { - log.Warn().Msgf( - "%s: %.2f seconds had passed when data is received", - symbol, - diff, - ) + diff := time.Since(data.GlobalAggregate.Timestamp) + if diff > 1*time.Second { + log.Warn().Int64("value", data.GlobalAggregate.Value).Dur("duration", diff).Str("Symbol", symbol).Str("Player", "DalCollector").Msg("processing incoming data") } - start := time.Now() result, err := c.IncomingDataToOutgoingData(ctx, data) - diff = time.Since(start).Seconds() - if diff > 3 { - log.Warn().Msgf("%s took %.2f seconds to process", symbol) - } if err != nil { log.Error().Err(err).Str("Player", "DalCollector").Msg("failed to convert incoming data to outgoing data")