File tree 3 files changed +12
-3
lines changed
sim-tests-lib/Test/Ouroboros/Network
src/Ouroboros/Network/TxSubmission/Inbound
3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -588,7 +588,7 @@ unit_txSubmission_allTransactions (ArbTxDecisionPolicy decisionPolicy)
588
588
case x of
589
589
-- When we add txids to the mempool, we collect them
590
590
-- into the map
591
- DiffusionTxSubmissionInbound (TraceTxInboundAddedToMempool txids) ->
591
+ DiffusionTxSubmissionInbound (TraceTxInboundAddedToMempool txids _ ) ->
592
592
Map. alter (maybe (Just [] ) (Just . sort . (txids ++ ))) n rr
593
593
-- When the node is shutdown we have to reset the accepted
594
594
-- txids list
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import Data.Set qualified as Set
16
16
import Control.Concurrent.Class.MonadSTM.Strict
17
17
import Control.Exception (assert )
18
18
import Control.Monad.Class.MonadThrow
19
+ import Control.Monad.Class.MonadTime.SI
19
20
import Control.Tracer (Tracer , traceWith )
20
21
21
22
import Network.TypedProtocol.Pipelined
@@ -43,6 +44,7 @@ txSubmissionInboundV2
43
44
:: forall txid tx idx m .
44
45
( MonadSTM m
45
46
, MonadThrow m
47
+ , MonadMonotonicTime m
46
48
, Ord txid
47
49
)
48
50
=> Tracer m (TraceTxSubmissionInbound txid tx )
@@ -70,9 +72,15 @@ txSubmissionInboundV2
70
72
txd@ TxDecision { txdTxsToRequest = txsToReq, txdTxsToMempool = txs }
71
73
<- readTxDecision
72
74
traceWith tracer (TraceTxInboundDecision txd)
75
+
76
+ ! start <- getMonotonicTime
73
77
txidsAccepted <- mempoolAddTxs txs
78
+ ! end <- getMonotonicTime
79
+ let duration = diffTime end start
80
+
74
81
traceWith tracer $
75
- TraceTxInboundAddedToMempool txidsAccepted
82
+ TraceTxInboundAddedToMempool txidsAccepted duration
83
+
76
84
let ! collected = length txs
77
85
let ! accepted = length txidsAccepted
78
86
traceWith tracer $
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ module Ouroboros.Network.TxSubmission.Inbound.Types
22
22
) where
23
23
24
24
import Control.Exception (Exception (.. ))
25
+ import Control.Monad.Class.MonadTime.SI
25
26
import Data.Map.Strict (Map )
26
27
import Data.Sequence.Strict (StrictSeq )
27
28
import Data.Set (Set )
@@ -294,7 +295,7 @@ data TraceTxSubmissionInbound txid tx =
294
295
-- | Server received 'MsgDone'
295
296
| TraceTxInboundCanRequestMoreTxs Int
296
297
| TraceTxInboundCannotRequestMoreTxs Int
297
- | TraceTxInboundAddedToMempool [txid ]
298
+ | TraceTxInboundAddedToMempool [txid ] DiffTime
298
299
299
300
--
300
301
-- messages emitted by the new implementation of the server in
You can’t perform that action at this time.
0 commit comments