コード例 #1
0
    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)
コード例 #2
0
ファイル: host.py プロジェクト: feichashao/virt-manager
    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)
コード例 #3
0
 def pretty_host_memory_size(self):
     if not self._backend.is_open():
         return ""
     return util.pretty_mem(self.host_memory_size())
コード例 #4
0
 def pretty_stats_memory(self):
     return util.pretty_mem(self.stats_memory())
コード例 #5
0
 def pretty_host_memory_size(self):
     if not self._backend.is_open():
         return ""
     return util.pretty_mem(self.host_memory_size())
コード例 #6
0
 def pretty_stats_memory(self):
     return util.pretty_mem(self.stats_memory())