From 60e7b76ec1c959ca15520f61ce3c07681d36c23d Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Tue, 3 Mar 2015 14:38:30 +0100 Subject: [PATCH] Instance NFData CollectorData ...so that we can force the states of stateful collectors. This is necessary to avoid thunks accumulating in unobserved collectors. Signed-off-by: Klaus Aehlig Reviewed-by: Petr Pudlak --- src/Ganeti/DataCollectors/Types.hs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Ganeti/DataCollectors/Types.hs b/src/Ganeti/DataCollectors/Types.hs index 55a84180f..59c5e8ca2 100644 --- a/src/Ganeti/DataCollectors/Types.hs +++ b/src/Ganeti/DataCollectors/Types.hs @@ -49,6 +49,7 @@ module Ganeti.DataCollectors.Types , getCategoryName ) where +import Control.DeepSeq (NFData, rnf, force) import Data.Char import Data.Ratio import qualified Data.Map as Map @@ -138,6 +139,9 @@ instance JSON DCVersion where -- | Type for the value field of the `CollectorMap` below. data CollectorData = CPULoadData (Seq.Seq (Integer, [Int])) +instance NFData CollectorData where + rnf (CPULoadData x) = rnf x + -- | Type for the map storing the data of the statefull DataCollectors. type CollectorMap = Map.Map String CollectorData -- GitLab