@@ -666,7 +666,7 @@ traceChainMetrics (Just _ekgDirect) tForks _blockConfig _fStats tr = do
666
666
-- TODO this is executed each time the newChain changes. How cheap is it?
667
667
meta <- mkLOMeta Critical Public
668
668
669
- traceD tr meta " density" ( fromRational density)
669
+ traceD tr meta " density" density
670
670
traceI tr meta " slotNum" slots
671
671
traceI tr meta " blockNum" blocks
672
672
traceI tr meta " slotInEpoch" slotInEpoch
@@ -1103,7 +1103,7 @@ traceLeadershipChecks _ft nodeKern _tverb tr = Tracer $
1103
1103
\ (utxoSize, delegMapSize, chainDensity) ->
1104
1104
[ (" utxoSize" , toJSON utxoSize)
1105
1105
, (" delegMapSize" , toJSON delegMapSize)
1106
- , (" chainDensity" , toJSON ( fromRational chainDensity :: Float ) )
1106
+ , (" chainDensity" , toJSON chainDensity)
1107
1107
])
1108
1108
)
1109
1109
_ -> pure ()
@@ -1716,7 +1716,7 @@ traceInboundGovernorCountersMetrics (OnOff True) (Just ekgDirect) = ipgcTracer
1716
1716
data ChainInformation = ChainInformation
1717
1717
{ slots :: Word64
1718
1718
, blocks :: Word64
1719
- , density :: Rational
1719
+ , density :: Double
1720
1720
-- ^ the actual number of blocks created over the maximum expected number
1721
1721
-- of blocks that could be created over the span of the last @k@ blocks.
1722
1722
, epoch :: EpochNo
@@ -1772,12 +1772,12 @@ chainInformation selChangedInfo fork oldFrag frag blocksUncoupledDelta = ChainIn
1772
1772
1773
1773
fragmentChainDensity ::
1774
1774
HasHeader (Header blk )
1775
- => AF. AnchoredFragment (Header blk ) -> Rational
1775
+ => AF. AnchoredFragment (Header blk ) -> Double
1776
1776
fragmentChainDensity frag = calcDensity blockD slotD
1777
1777
where
1778
- calcDensity :: Word64 -> Word64 -> Rational
1778
+ calcDensity :: Word64 -> Word64 -> Double
1779
1779
calcDensity bl sl
1780
- | sl > 0 = toRational bl / toRational sl
1780
+ | sl > 0 = fromIntegral bl / fromIntegral sl
1781
1781
| otherwise = 0
1782
1782
slotN = unSlotNo $ fromWithOrigin 0 (AF. headSlot frag)
1783
1783
-- Slot of the tip - slot @k@ blocks back. Use 0 as the slot for genesis
0 commit comments