Skip to content

Commit

Permalink
CAD-650 make pattern matches complete
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Diemand <[email protected]>
  • Loading branch information
CodiePP committed Mar 10, 2020
1 parent ed1f730 commit 581d52f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cardano-node/src/Cardano/Tracing/MicroBenchmarking.hs
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ instance (Monad m, MonadTime m) => Outcome m (TraceForgeEvent blk (GenTx blk)) w
classifyObservable = pure . \case
TraceNodeIsLeader {} -> OutcomeStarts
TraceForgedBlock {} -> OutcomeEnds
_ -> OutcomeOther

--captureObservableValue :: a -> m (IntermediateValue a)
captureObservableValue (TraceNodeIsLeader slotNo) = do
Expand All @@ -190,6 +191,12 @@ instance (Monad m, MonadTime m) => Outcome m (TraceForgeEvent blk (GenTx blk)) w
time <- getMonotonicTime
pure (slotNo, time, mempoolSize)

-- will never be called, just to make the pattern match complete
captureObservableValue _ = do
time <- getMonotonicTime
pure (0, time, mempty)


--computeOutcomeMetric :: a -> IntermediateValue a -> IntermediateValue a -> m (OutcomeMetric a)
computeOutcomeMetric _ (startSlot, absTimeStart, _) (stopSlot, absTimeStop, mempoolSize)
| startSlot == stopSlot = pure $ Just (startSlot, (diffTime absTimeStop absTimeStart), mempoolSize)
Expand Down

0 comments on commit 581d52f

Please sign in to comment.