From 581d52fcdd38afbf50c0837375f732c849170ef9 Mon Sep 17 00:00:00 2001 From: Alexander Diemand Date: Tue, 10 Mar 2020 08:49:46 +0100 Subject: [PATCH] CAD-650 make pattern matches complete Signed-off-by: Alexander Diemand --- cardano-node/src/Cardano/Tracing/MicroBenchmarking.hs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cardano-node/src/Cardano/Tracing/MicroBenchmarking.hs b/cardano-node/src/Cardano/Tracing/MicroBenchmarking.hs index 7188f86bdc1..5420cc679d9 100644 --- a/cardano-node/src/Cardano/Tracing/MicroBenchmarking.hs +++ b/cardano-node/src/Cardano/Tracing/MicroBenchmarking.hs @@ -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 @@ -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)