Merge lp:~jelmer/meliae/hurd into lp:meliae

Proposed by Jelmer Vernooij
Status: Merged
Approved by: John A Meinel
Approved revision: 200
Merged at revision: 231
Proposed branch: lp:~jelmer/meliae/hurd
Merge into: lp:meliae
Diff against target: 43 lines (+16/-0)
2 files modified
CHANGES.txt (+3/-0)
meliae/perf_counter.py (+13/-0)
To merge this branch: bzr merge lp:~jelmer/meliae/hurd
Reviewer Review Type Date Requested Status
John A Meinel Approve
Review via email: mp+313867@code.launchpad.net

Description of the change

Raise NotImplementedError when trying to get memory details on GNU/Hurd.

To post a comment you must log in.
Revision history for this message
John A Meinel (jameinel) wrote :

I'm guessing this is now going to the wrong place in CHANGES.txt, but I'm fine with having this added

Revision history for this message
John A Meinel (jameinel) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CHANGES.txt'
2--- CHANGES.txt 2011-11-01 15:25:57 +0000
3+++ CHANGES.txt 2016-12-25 17:55:34 +0000
4@@ -14,6 +14,9 @@
5 'obj[-1]' to get the last child, (same as obj.c[-1]).
6 (Robert Xiao, #882356)
7
8+* Raise NotImplementedError when trying to get memory counters on
9+ GNU/Hurd. (Jelmer Vernooij)
10+
11 Meliae 0.4
12 ##########
13
14
15=== modified file 'meliae/perf_counter.py'
16--- meliae/perf_counter.py 2010-07-12 20:10:34 +0000
17+++ meliae/perf_counter.py 2016-12-25 17:55:34 +0000
18@@ -120,6 +120,17 @@
19 return current, peak
20
21
22+class _HurdPerformanceCounter(PerformanceCounter):
23+
24+ def get_timer(self):
25+ # This returns wall-clock time
26+ return time.time
27+
28+ def get_memory(self, process):
29+ # TODO: Implement support for GNU Hurd.
30+ raise NotImplementedError(self.get_memory)
31+
32+
33 class _Win32PerformanceCounter(PerformanceCounter):
34
35 def get_timer(self):
36@@ -174,6 +185,8 @@
37 ('PeakPagefileUsage', ctypes.c_size_t),
38 ('PrivateUsage', ctypes.c_size_t),
39 ]
40+elif sys.platform == 'gnu0':
41+ perf_counter = _HurdPerformanceCounter()
42 else:
43 perf_counter = _LinuxPerformanceCounter()
44

Subscribers

People subscribed via source and target branches

to all changes: