~ubuntu-branches/debian/sid/meliae/sid

« back to all changes in this revision

Viewing changes to track_memory.py

  • Committer: Bazaar Package Importer
  • Author(s): Jelmer Vernooij
  • Date: 2010-07-20 18:26:22 UTC
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20100720182622-b0ks0nu34mify1lj
Tags: upstream-0.2.1
ImportĀ upstreamĀ versionĀ 0.2.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2009 Canonical Ltd
 
1
# Copyright (C) 2009, 2010 Canonical Ltd
2
2
3
3
# This program is free software: you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License version 3 as
32
32
    while p.poll() is None:
33
33
        now = timer()
34
34
        cur_mem, peak_mem = perf_counter.perf_counter.get_memory(p)
 
35
        if cur_mem is None or peak_mem is None:
 
36
            p.wait()
 
37
            break
35
38
        mem_secs += cur_mem * (now - last)
36
39
        last = now
37
40
        time.sleep(opts.sleep_time)