From 76a20994b3eb124d906607292e0d959ea166e9a0 Mon Sep 17 00:00:00 2001 From: Iustin Pop Date: Wed, 25 Jan 2012 11:21:36 +0100 Subject: [PATCH] Add a new type for holding allocation statistics MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The current RSpec type doesn't cut it anymore (and it's used in other places), so let's introduce a separate type for holding these statistics. Signed-off-by: Iustin Pop Reviewed-by: René Nussbaumer --- htools/Ganeti/HTools/Types.hs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/htools/Ganeti/HTools/Types.hs b/htools/Ganeti/HTools/Types.hs index 5ed0a47..a2d640b 100644 --- a/htools/Ganeti/HTools/Types.hs +++ b/htools/Ganeti/HTools/Types.hs @@ -41,6 +41,7 @@ module Ganeti.HTools.Types , instanceStatusFromRaw , instanceStatusToRaw , RSpec(..) + , AllocInfo(..) , DynUtil(..) , zeroUtil , baseUtil @@ -154,6 +155,17 @@ data RSpec = RSpec , rspecDsk :: Int -- ^ Requested disk } deriving (Show, Read, Eq) +-- | Allocation stats type. This is used instead of 'RSpec' (which was +-- used at first), because we need to track more stats. The actual +-- data can refer either to allocated, or available, etc. values +-- depending on the context. See also +-- 'Cluster.computeAllocationDelta'. +data AllocInfo = AllocInfo + { allocInfoVCpus :: Int -- ^ VCPUs + , allocInfoNCpus :: Double -- ^ Normalised CPUs + , allocInfoMem :: Int -- ^ Memory + , allocInfoDisk :: Int -- ^ Disk + } deriving (Show, Read, Eq) -- | Instance specification type. $(THH.buildObject "ISpec" "iSpec" -- 1.7.10.4