def refresh_resources(self, ignore=None): vm_memory = util.pretty_mem(self.conn.stats_memory()) host_memory = util.pretty_mem(self.conn.host_memory_size()) cpu_vector = self.conn.host_cpu_time_vector() memory_vector = self.conn.stats_memory_vector() cpu_vector.reverse() memory_vector.reverse() self.widget("performance-cpu").set_text("%d %%" % self.conn.host_cpu_time_percentage()) self.widget("performance-memory").set_text( _("%(currentmem)s of %(maxmem)s") % {'currentmem': vm_memory, 'maxmem': host_memory}) self.cpu_usage_graph.set_property("data_array", cpu_vector) self.memory_usage_graph.set_property("data_array", memory_vector)
def pretty_host_memory_size(self): if not self._backend.is_open(): return "" return util.pretty_mem(self.host_memory_size())
def pretty_stats_memory(self): return util.pretty_mem(self.stats_memory())