Skip to content

Commit

Permalink
better logs
Browse files Browse the repository at this point in the history
  • Loading branch information
jonfung-dydx committed Jul 26, 2024
1 parent 9c0cf40 commit 101557b
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions protocol/x/clob/keeper/grpc_stream_orderbook.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,18 @@ func (k Keeper) CompareMemclobOrderbookWithLocalOrderbook(
}

ratio := float32(numFailed) * 100 / float32(numPassed+numFailed)
logger.Error(
fmt.Sprintf("Fill amount comparison results: %.2f failed", ratio),
"failed", numFailed,
"passed", numPassed,
"in_orderbook_not_state", numInOrderbookButNotState,
)

logger.Info("Orderbook comparison done!")
if numFailed+numPassed > 0 {
if numFailed > 0 {
logger.Error(
fmt.Sprintf("Fill amount comparison results: %.2f failed", ratio),
"failed", numFailed,
"passed", numPassed,
"in_orderbook_not_state", numInOrderbookButNotState,
)
} else {
logger.Info("Orderbook comparison done successfully!")
}
} else {
logger.Info("No checks done on fill amounts.")
}
}

0 comments on commit 101557b

Please sign in to comment.