Skip to content

Commit

Permalink
feat: print log
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-bisonai committed Jul 30, 2024
1 parent fc4911f commit c5c7224
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions node/pkg/dal/collector/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit c5c7224

Please sign in to comment.