Revision 4886952e hspace.hs

b/hspace.hs
154 154
  -- this should be the final entry
155 155
  printKeys [("OK", "1")]
156 156

  
157
formatRSpec :: String -> RSpec -> [(String, String)]
158
formatRSpec s r =
157
formatRSpec :: Double -> String -> RSpec -> [(String, String)]
158
formatRSpec m_cpu s r =
159 159
    [ ("KM_" ++ s ++ "_CPU", show $ rspecCpu r)
160
    , ("KM_" ++ s ++ "_NPU", show $ fromIntegral (rspecCpu r) / m_cpu)
160 161
    , ("KM_" ++ s ++ "_MEM", show $ rspecMem r)
161 162
    , ("KM_" ++ s ++ "_DSK", show $ rspecDsk r)
162 163
    ]
163 164

  
164
printAllocationStats :: Node.List -> Node.List -> IO ()
165
printAllocationStats ini_nl fin_nl = do
165
printAllocationStats :: Double -> Node.List -> Node.List -> IO ()
166
printAllocationStats m_cpu ini_nl fin_nl = do
166 167
  let ini_stats = Cluster.totalResources ini_nl
167 168
      fin_stats = Cluster.totalResources fin_nl
168 169
      (rini, ralo, runa) = Cluster.computeAllocationDelta ini_stats fin_stats
169
  printKeys $ formatRSpec "USED" rini
170
  printKeys $ formatRSpec "POOL" ralo
171
  printKeys $ formatRSpec "UNAV" runa
170
  printKeys $ formatRSpec m_cpu  "USED" rini
171
  printKeys $ formatRSpec m_cpu "POOL"ralo
172
  printKeys $ formatRSpec m_cpu "UNAV" runa
172 173

  
173 174
-- | Ensure a value is quoted if needed
174 175
ensureQuoted :: String -> String
......
318 319
                             out_path
319 320
       printKeys $ printStats PTiered (Cluster.totalResources trl_nl)
320 321
       printKeys [("TSPEC", intercalate " " spec_map')]
321
       printAllocationStats nl trl_nl)
322
       printAllocationStats m_cpu nl trl_nl)
322 323

  
323 324
  -- Run the standard (avg-mode) allocation
324 325

  

Also available in: Unified diff