Skip to content

set compatibility how to get swap memory for get_memory_maps() in OS X - #78

Merged
sylvinus merged 1 commit into
pricingassistant:masterfrom
chenull:master
Apr 10, 2015
Merged

set compatibility how to get swap memory for get_memory_maps() in OS X#78
sylvinus merged 1 commit into
pricingassistant:masterfrom
chenull:master

Conversation

@chenull

@chenull chenull commented Apr 9, 2015

Copy link
Copy Markdown
Contributor

Hi, in my laptop (OS X) i got error:

2015-04-10 03:11:05,240 DEBG 'mrq-worker0' stderr output:

  File "/Users/ayik/Repositories/python/mrq/mrq/worker.py", line 351, in work
    return self.work_stop()
  File "/Users/ayik/Repositories/python/mrq/mrq/worker.py", line 456, in work_stop
    self.report_worker(w=1)
  File "/Users/ayik/Repositories/python/mrq/mrq/worker.py", line 295, in report_worker
    report = self.get_worker_report()
  File "/Users/ayik/Repositories/python/mrq/mrq/worker.py", line 248, in get_worker_report
    mem = self.get_memory()
  File "/Users/ayik/Repositories/python/mrq/mrq/worker.py", line 195, in get_memory
    "swap": sum([x.swap for x in mmaps])
AttributeError: 'mmap' object has no attribute 'swap'

In OS X, swap memory is using attribute "swapped" instead of "swap". So, I think it could be simply resolved using this pull request. It's just one line change, and should pass tests, hopefully :D sorry, i didn't test it since it needed to setup docker, which i don't have right now

@sylvinus

Copy link
Copy Markdown
Contributor

Didn't know that, thanks! Too bad psutil doesn't abstract that away :/

sylvinus added a commit that referenced this pull request Apr 10, 2015
set compatibility how to get swap memory for get_memory_maps() in OS X
@sylvinus
sylvinus merged commit 777a38b into pricingassistant:master Apr 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants