@@ -59,8 +59,8 @@ deriving instance (Show (f NominalDiffTime), Show (f Int)) => Show (
59
59
deriving instance (FromJSON (f NominalDiffTime ), FromJSON (f Int )) => FromJSON (BlockProp f )
60
60
deriving instance (ToJSON (f NominalDiffTime ), ToJSON (f Int )) => ToJSON (BlockProp f )
61
61
62
- type BlockPropOne = BlockProp I
63
- type BlockProps = BlockProp (CDF I )
62
+ type BlockPropOne = BlockProp I
63
+ type MultiBlockProp = BlockProp (CDF I )
64
64
65
65
-- | All events related to a block.
66
66
data BlockEvents
@@ -215,8 +215,8 @@ type ClusterPerf = MachPerf (CDF I)
215
215
216
216
-- | Bunch'a bunches'a machine performances.
217
217
-- Same as above, since we collapse [CDF I] into CDF I -- just with more statistical confidence.
218
- newtype ClusterPerfs
219
- = ClusterPerfs { unClusterPerfs :: ClusterPerf }
218
+ newtype MultiClusterPerf
219
+ = MultiClusterPerf { unMultiClusterPerf :: ClusterPerf }
220
220
deriving newtype (ToJSON , FromJSON )
221
221
222
222
deriving newtype instance FromJSON a => FromJSON (I a )
@@ -306,17 +306,27 @@ testSlotStats g SlotStats{..} = \case
306
306
--
307
307
-- * Timeline rendering instances
308
308
--
309
- bpFieldsForger :: Field DSelect p a -> Bool
310
- bpFieldsForger Field {fId} = elem fId
309
+ bpFieldSelectForger :: Field DSelect p a -> Bool
310
+ bpFieldSelectForger Field {fId} = elem fId
311
311
[ " fChecked" , " fLeading" , " fForged" , " fAdopted" , " fAnnounced" , " fSendStart" ]
312
312
313
- bpFieldsPeers :: Field DSelect p a -> Bool
314
- bpFieldsPeers Field {fId} = elem fId
315
- [ " noticedVal " , " requestedVal " , " fetchedVal " , " pAdoptedVal " , " pAnnouncedVal " , " pSendStartVal " ]
313
+ bpFieldSelectPeers :: Field DSelect p a -> Bool
314
+ bpFieldSelectPeers Field {fId} = elem fId
315
+ [ " pNoticed " , " pRequested " , " pFetched " , " pAdopted " , " pAnnounced " , " pSendStart " ]
316
316
317
- bpFieldsPropagation :: Field DSelect p a -> Bool
318
- bpFieldsPropagation Field {fHead2} = elem fHead2
319
- [ " 0.50" , " 0.80" , " 0.90" , " 0.92" , " 0.94" , " 0.96" , " 0.98" , " 1.00" ]
317
+ bpFieldSelectPropagation :: Field DSelect p a -> Bool
318
+ bpFieldSelectPropagation Field {fHead2} = elem fHead2 adoptionPctsRendered
319
+
320
+ renderAdoptionCentile :: Centile -> Text
321
+ renderAdoptionCentile = T. pack . printf " prop%0.2f" . unCentile
322
+
323
+ adoptionPctsRendered :: [Text ]
324
+ adoptionPctsRendered = adoptionPcts <&> T. drop 4 . renderAdoptionCentile
325
+
326
+ adoptionPcts :: [Centile ]
327
+ adoptionPcts =
328
+ [ Centile 0.5 , Centile 0.8 , Centile 0.9
329
+ , Centile 0.92 , Centile 0.94 , Centile 0.96 , Centile 0.98 , Centile 1.0 ]
320
330
321
331
instance RenderCDFs BlockProp p where
322
332
rdFields =
@@ -334,27 +344,24 @@ instance RenderCDFs BlockProp p where
334
344
, Field 5 0 " pAnnounced" (p!! 4 ) " Annou" $ DDeltaT bpPeerAnnouncements
335
345
, Field 5 0 " pSendStart" (p!! 5 ) " Send" $ DDeltaT bpPeerSends
336
346
] ++
337
- [ Field 5 0 (printf " prop%.02f " ps & T. pack )
347
+ [ Field 5 0 (renderAdoptionCentile ct )
338
348
(r!! i)
339
- (T. take 4 $ T. pack $ printf " %.04f" ps)
340
- (DDeltaT ((\ (ps', d) ->
341
- if ps' == ps then d
342
- else error $ printf " Centile mismatch: [%d]: exp=%f act=%f" i ps ps')
349
+ (T. take 4 $ T. pack $ printf " %.04f" centi)
350
+ (DDeltaT ((\ (centi', d) ->
351
+ if centi' == centi then d
352
+ else error $ printf " Centile mismatch: [%d]: exp=%f act=%f"
353
+ i centi centi')
343
354
. fromMaybe
344
- (error $ printf " No centile %d/%f in bpPropagation." i ps )
355
+ (error $ printf " No centile %d/%f in bpPropagation." i centi )
345
356
. flip atMay i . bpPropagation))
346
- | (i, Centile ps) <- zip [0 :: Int .. ] ( adoptionPcts <> [ Centile 1.0 ]) ] ++
357
+ | (i, ct @ ( Centile centi)) <- zip [0 :: Int .. ] adoptionPcts ] ++
347
358
[ Field 9 0 " sizes" " Size" " bytes" $ DInt bpSizes
348
359
]
349
360
where
350
361
f = nChunksEachOf 6 7 " --- Forger event Δt: ---"
351
362
p = nChunksEachOf 6 6 " --- Peer event Δt: ---"
352
363
r = nChunksEachOf aLen 6 " Slot-rel. Δt to adoption centile:"
353
- aLen = length adoptionPcts + 1 -- +1 is for the implied 1.0 centile
354
-
355
- adoptionPcts :: [Centile ]
356
- adoptionPcts =
357
- [ Centile 0.5 , Centile 0.8 , Centile 0.9 , Centile 0.92 , Centile 0.94 , Centile 0.96 , Centile 0.98 ]
364
+ aLen = length adoptionPcts
358
365
359
366
instance RenderTimeline BlockEvents where
360
367
rtFields _ =
@@ -382,7 +389,7 @@ instance RenderTimeline BlockEvents where
382
389
, Field 5 0 " pSendStartVal" (p!! 5 ) " Send" $ IDeltaT (af' boSending . valids)
383
390
, Field 5 0 " pPropag0.5" (r!! 0 ) " 0.5" $ IDeltaT (percSpec 0.5 . bePropagation)
384
391
, Field 5 0 " pPropag0.96" (r!! 1 ) " 0.96" $ IDeltaT (percSpec 0.96 . bePropagation)
385
- , Field 5 0 " pPropag1.0" (r!! 2 ) " 1.0" $ IDeltaT (percSpec 1.0 . bePropagation)
392
+ , Field 5 0 " pPropag1.0" (r!! 2 ) " 1.0" $ IDeltaT (snd . cdfRange . bePropagation)
386
393
, Field 5 0 " errors" " all" " errs" $ IInt (length . beErrors)
387
394
, Field 3 0 " missAdopt" (m!! 0 ) " ado" $ IInt (count (bpeIsMissing Adopt ) . beErrors)
388
395
, Field 3 0 " missAnnou" (m!! 1 ) " ann" $ IInt (count (bpeIsMissing Announce ) . beErrors)
0 commit comments