Commit 76a20994 authored by Iustin Pop's avatar Iustin Pop
Browse files

Add a new type for holding allocation statistics



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: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarRené Nussbaumer <rn@google.com>
parent 90c2f1e8
......@@ -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"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment