File tree Expand file tree Collapse file tree 3 files changed +12
-3
lines changed
sim-tests-lib/Test/Ouroboros/Network/Diffusion/Testnet
src/Ouroboros/Network/TxSubmission/Inbound Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -934,7 +934,7 @@ unit_txSubmission_allTransactions (ArbTxDecisionPolicy decisionPolicy)
934934 case x of
935935 -- When we add txids to the mempool, we collect them
936936 -- into the map
937- DiffusionTxSubmissionInbound (TraceTxInboundAddedToMempool txids) ->
937+ DiffusionTxSubmissionInbound (TraceTxInboundAddedToMempool txids _ ) ->
938938 Map. alter (maybe (Just [] ) (Just . sort . (txids ++ ))) n rr
939939 -- When the node is shutdown we have to reset the accepted
940940 -- txids list
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import Data.Set qualified as Set
1616import Control.Concurrent.Class.MonadSTM.Strict
1717import Control.Exception (assert )
1818import Control.Monad.Class.MonadThrow
19+ import Control.Monad.Class.MonadTime.SI
1920import Control.Tracer (Tracer , traceWith )
2021
2122import Network.TypedProtocol
@@ -43,6 +44,7 @@ txSubmissionInboundV2
4344 :: forall txid tx idx m .
4445 ( MonadSTM m
4546 , MonadThrow m
47+ , MonadMonotonicTime m
4648 , Ord txid
4749 )
4850 => Tracer m (TraceTxSubmissionInbound txid tx )
@@ -70,9 +72,15 @@ txSubmissionInboundV2
7072 txd@ TxDecision { txdTxsToRequest = txsToReq, txdTxsToMempool = txs }
7173 <- readTxDecision
7274 traceWith tracer (TraceTxInboundDecision txd)
75+
76+ ! start <- getMonotonicTime
7377 txidsAccepted <- mempoolAddTxs txs
78+ ! end <- getMonotonicTime
79+ let duration = diffTime end start
80+
7481 traceWith tracer $
75- TraceTxInboundAddedToMempool txidsAccepted
82+ TraceTxInboundAddedToMempool txidsAccepted duration
83+
7684 let ! collected = length txs
7785 let ! accepted = length txidsAccepted
7886 traceWith tracer $
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ module Ouroboros.Network.TxSubmission.Inbound.Types
2424 ) where
2525
2626import Control.Exception (Exception (.. ))
27+ import Control.Monad.Class.MonadTime.SI
2728import Data.Map.Strict (Map )
2829import Data.Sequence.Strict (StrictSeq )
2930import Data.Set (Set )
@@ -297,7 +298,7 @@ data TraceTxSubmissionInbound txid tx =
297298 -- | Server received 'MsgDone'
298299 | TraceTxInboundCanRequestMoreTxs Int
299300 | TraceTxInboundCannotRequestMoreTxs Int
300- | TraceTxInboundAddedToMempool [txid ]
301+ | TraceTxInboundAddedToMempool [txid ] DiffTime
301302
302303 --
303304 -- messages emitted by the new implementation of the server in
You can’t perform that action at this time.
0 commit comments