Skip to content

Commit

Permalink
log timestamps for pairs in dal collector
Browse files Browse the repository at this point in the history
  • Loading branch information
Intizar-T committed Jul 30, 2024
1 parent b9c096b commit 85c4a56
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions node/pkg/dal/collector/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"os"
"strconv"
"sync"
"time"

"bisonai.com/orakl/node/pkg/aggregator"
"bisonai.com/orakl/node/pkg/chain/websocketchainreader"
Expand Down Expand Up @@ -157,7 +158,17 @@ 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]
log.Info().Msgf(
"%s: %.2f seconds had passed when data is received",
symbol,
time.Since(data.GlobalAggregate.Timestamp).Seconds(),
)

start := time.Now()
result, err := c.IncomingDataToOutgoingData(ctx, data)
log.Info().Msgf("%s took %.2f seconds to process", symbol, time.Since(start).Seconds())

if err != nil {
log.Error().Err(err).Str("Player", "DalCollector").Msg("failed to convert incoming data to outgoing data")
return
Expand Down

0 comments on commit 85c4a56

Please sign in to comment.