{-
-Copyright (C) 2009 Google Inc.
+Copyright (C) 2009, 2010 Google Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
, NameAssoc
, Score
, Weight
+ , GroupID
, RSpec(..)
, DynUtil(..)
, zeroUtil
, unitMem
, unitCpu
, unitDsk
+ , unknownField
, Placement
, IMove(..)
, MoveJob
-- | A separate name for a weight metric.
type Weight = Double
+-- | The Group UUID type
+type GroupID = String
+
-- | The resource spec type.
data RSpec = RSpec
{ rspecCpu :: Int -- ^ Requested VCPUs
, memWeight :: Weight -- ^ Standardised memory load
, dskWeight :: Weight -- ^ Standardised disk I\/O usage
, netWeight :: Weight -- ^ Standardised network usage
- } deriving (Show)
+ } deriving (Show, Eq)
-- | Initial empty utilisation
zeroUtil :: DynUtil
-- commands
type MoveJob = ([Ndx], Idx, IMove, [String])
+-- | Unknown field in table output
+unknownField :: String
+unknownField = "<unknown field>"
+
-- | A list of command elements
type JobSet = [MoveJob]
class Element a where
-- | Returns the name of the element
nameOf :: a -> String
+ -- | Returns all the known names of the element
+ allNames :: a -> [String]
-- | Returns the index of the element
idxOf :: a -> Int
-- | Updates the alias of the element