2880: API server saves node statistics from pings.
[arvados.git] / services / api / app / models / node.rb
index 2ca05f62d59cc620d4e1b4fc8f48799c69c10266..71d4dea2c0cc815c7b29c30c8d0d7dac40c31cf1 100644 (file)
@@ -115,6 +115,15 @@ class Node < ArvadosModel
       end
     end
 
+    # Record other basic stats
+    ['total_cpu_cores', 'total_ram_mb', 'total_scratch_mb'].each do |key|
+      if value = (o[key] or o[key.to_sym])
+        self.info[key] = value
+      else
+        self.info.delete(key)
+      end
+    end
+
     save!
   end