def parse_memory(self, mem_fields=('MemTotal', 'MemFree')): ''' Parse memory info from output of get_memory(). Returned key, value pairs depend on keywords defined in mem_fields, which MUST be a tuple: self.parse_memory(('MemTotal',)) Search is case sensitive. Returned structure is a dictionary: {key: value, ...} ''' return utils.parser_memory(self.get_memory(), mem_fields)
def parse_memory(self, mem_fields = ('unix:0:system_pages:physmem', 'unix:0:system_pages:freemem')): ''' Parse output from get_memory(). Returned key, value pairs depend on keywords defined in mem_fields, whish MUST be a tuple: self.parse_memory(('unix:0:system_pages:physmem',)) Search is case sensitive. By default, returned values are pages of memory. Returned structure is a dictionary: {key: value, ...} ''' return utils.parser_memory(self.get_memory(), mem_fields)
def parse_memory(self, mem_fields=('vm.stats.vm.v_page_count', 'vm.stats.vm.v_free_count', 'vm.stats.vm.v_inactive_count', 'vm.stats.vm.v_cache_count')): ''' Parse output from get_memory(). Returned key, value pairs depend on keywords defined in mem_fields, which MUST be a tuple: self.parse_memory(('vm.stats.vm.v_page_count',)) Search is case sensitive. By default, returned values are pages of memory. Returned structure is a dictionary. {key: value, ...} free = v_free_count + v_inactive_count + v_cache_count ''' return utils.parser_memory(self.get_memory(), mem_fields)