Revision 90c2f1e8 htools/Ganeti/HTools/Cluster.hs
b/htools/Ganeti/HTools/Cluster.hs  

154  154 
, csTmem :: Double  ^ Cluster total mem 
155  155 
, csTdsk :: Double  ^ Cluster total disk 
156  156 
, csTcpu :: Double  ^ Cluster total cpus 
157 
, csVcpu :: Integer  ^ Cluster virtual cpus (if


158 
 node pCpu has been set,


159 
 otherwise 1)


157 
, csVcpu :: Integer  ^ Cluster total virtual cpus


158 
, csNcpu :: Double  ^ Equivalent to 'csIcpu' but in terms of


159 
 physical CPUs, i.e. normalised used phys CPUs


160  160 
, csXmem :: Integer  ^ Unnacounted for mem 
161  161 
, csNmem :: Integer  ^ Node own memory 
162  162 
, csScore :: Score  ^ The cluster score 
...  ...  
213  213  
214  214 
  Zeroinitializer for the CStats type. 
215  215 
emptyCStats :: CStats 
216 
emptyCStats = CStats 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 

216 
emptyCStats = CStats 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0


217  217  
218  218 
  Update stats with data from a new node. 
219  219 
updateCStats :: CStats > Node.Node > CStats 
...  ...  
223  223 
csMmem = x_mmem, csMdsk = x_mdsk, csMcpu = x_mcpu, 
224  224 
csImem = x_imem, csIdsk = x_idsk, csIcpu = x_icpu, 
225  225 
csTmem = x_tmem, csTdsk = x_tdsk, csTcpu = x_tcpu, 
226 
csVcpu = x_vcpu, 

226 
csVcpu = x_vcpu, csNcpu = x_ncpu,


227  227 
csXmem = x_xmem, csNmem = x_nmem, csNinst = x_ninst 
228  228 
} 
229  229 
= cs 
...  ...  
236  236 
inc_idsk = truncate (Node.tDsk node)  Node.fDsk node 
237  237 
inc_vcpu = Node.hiCpu node 
238  238 
inc_acpu = Node.availCpu node 
239 
inc_ncpu = fromIntegral (Node.uCpu node) / 

240 
iPolicyVcpuRatio (Node.iPolicy node) 

239  241 
in cs { csFmem = x_fmem + fromIntegral (Node.fMem node) 
240  242 
, csFdsk = x_fdsk + fromIntegral (Node.fDsk node) 
241  243 
, csAmem = x_amem + fromIntegral inc_amem' 
...  ...  
251  253 
, csTdsk = x_tdsk + Node.tDsk node 
252  254 
, csTcpu = x_tcpu + Node.tCpu node 
253  255 
, csVcpu = x_vcpu + fromIntegral inc_vcpu 
256 
, csNcpu = x_ncpu + inc_ncpu 

254  257 
, csXmem = x_xmem + fromIntegral (Node.xMem node) 
255  258 
, csNmem = x_nmem + fromIntegral (Node.nMem node) 
256  259 
, csNinst = x_ninst + length (Node.pList node) 
Also available in: Unified diff