File tree 3 files changed +12
-3
lines changed
sim-tests-lib/Test/Ouroboros/Network/Diffusion/Testnet
src/Ouroboros/Network/TxSubmission/Inbound
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)
934
934
case x of
935
935
-- When we add txids to the mempool, we collect them
936
936
-- into the map
937
- DiffusionTxSubmissionInbound (TraceTxInboundAddedToMempool txids) ->
937
+ DiffusionTxSubmissionInbound (TraceTxInboundAddedToMempool txids _ ) ->
938
938
Map. alter (maybe (Just [] ) (Just . sort . (txids ++ ))) n rr
939
939
-- When the node is shutdown we have to reset the accepted
940
940
-- 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
@@ -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 @@ -24,6 +24,7 @@ module Ouroboros.Network.TxSubmission.Inbound.Types
24
24
) where
25
25
26
26
import Control.Exception (Exception (.. ))
27
+ import Control.Monad.Class.MonadTime.SI
27
28
import Data.Map.Strict (Map )
28
29
import Data.Sequence.Strict (StrictSeq )
29
30
import Data.Set (Set )
@@ -297,7 +298,7 @@ data TraceTxSubmissionInbound txid tx =
297
298
-- | Server received 'MsgDone'
298
299
| TraceTxInboundCanRequestMoreTxs Int
299
300
| TraceTxInboundCannotRequestMoreTxs Int
300
- | TraceTxInboundAddedToMempool [txid ]
301
+ | TraceTxInboundAddedToMempool [txid ] DiffTime
301
302
302
303
--
303
304
-- messages emitted by the new implementation of the server in
You can’t perform that action at this time.
0 commit comments