@@ -54,7 +54,6 @@ main = do
55 "client" : host : service : sourceAddrFilePath : sizeStr : args' -> do
55 "client" : host : service : sourceAddrFilePath : sizeStr : args' -> do
56 let size = read sizeStr
56 let size = read sizeStr
57− let bs = BS.replicate size 0
59 -- establish transport
58 -- establish transport
60 transport <- mkTransport $ TCPConfig defaultHints host service
59 transport <- mkTransport $ TCPConfig defaultHints host service
@@ -67,7 +66,8 @@ main = do
67 (sourceAddrPong, targetEndPong) <- newConnection transport
66 (sourceAddrPong, targetEndPong) <- newConnection transport
68 send sourceEndPing [serialize sourceAddrPong]
67 send sourceEndPing [serialize sourceAddrPong]
70− -- benchmark the pings
69+ -- benchmark the data
70+ let bs = BS.replicate size 0
71 withArgs args' $ defaultMain [ benchSend sourceEndPing targetEndPong bs ]
71 withArgs args' $ defaultMain [ benchSend sourceEndPing targetEndPong bs ]
73-- | The effect of `ping sourceEndPing targetEndPong bs` is to send the
73-- | The effect of `ping sourceEndPing targetEndPong bs` is to send the
@@ -91,6 +91,6 @@ pong targetEndPing sourceEndPong = do
91-- `bs` pings down `sourceEndPing` using the `ping` function. The time
91-- `bs` pings down `sourceEndPing` using the `ping` function. The time
92-- taken is benchmarked.
92-- taken is benchmarked.
93benchSend :: SourceEnd -> TargetEnd -> ByteString -> Benchmark
93benchSend :: SourceEnd -> TargetEnd -> ByteString -> Benchmark
94−benchSend sourceEndPing targetEndPong bs = bench "Transport Ping" $
94+benchSend sourceEndPing targetEndPong bs = bench "SendTransport" $
95 nfIO (ping sourceEndPing targetEndPong bs)
95 nfIO (ping sourceEndPing targetEndPong bs)