diff --git a/src/Ganeti/HTools/Node.hs b/src/Ganeti/HTools/Node.hs index a67fa3d6ccada0ea01c29aecb6beea24f7891c36..aa927f2d198ce87a422bcb4d3127e29cfc0561d3 100644 --- a/src/Ganeti/HTools/Node.hs +++ b/src/Ganeti/HTools/Node.hs @@ -28,6 +28,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA module Ganeti.HTools.Node ( Node(..) , List + , pCpuEff -- * Constructor , create -- ** Finalization after data loading @@ -167,6 +168,11 @@ instance T.Element Node where setIdx = setIdx allNames n = [name n, alias n] +-- | Derived parameter: ratio of virutal to pysical CPUs, weighted +-- by CPU speed. +pCpuEff :: Node -> Double +pCpuEff n = pCpu n / tCpuSpeed n + -- | A simple name for the int, node association list. type AssocList = [(T.Ndx, Node)]