|
|
| Author |
Message |
|
| sean |
Posted: Mon Mar 07, 2005 10:05 pm |
|
|
|
User
Joined: 27 Feb 2005
Posts: 50
|
Hi,
os_mon-1.6.2 is still broken under OS X darwin.
The following patch restores what was in my original patch. This makes
the solution much less susceptible to changes in the output of uptime.
Regards,
Sean
--- cpu_sup.erl.orig Fri Jun 25 14:25:58 2004
+++ cpu_sup.erl Mon Mar 7 21:50:04 2005
_at__at_ -274,11 +274,11 _at__at_
end;
get_int_measurement(Request, #state{os_type = {unix, darwin}}) ->
D = os:cmd("uptime") -- "\n",
- {ok, [L1, L5, L15], _} =
io_lib:fread("~*s~*s~*s~*s~*s~*s~*s~f,~f,~f", D),
+ [L15, L5, L1|_] = lists:reverse(string:tokens(D, ", ")),
case Request of
- ?avg1 -> sunify(L1);
- ?avg5 -> sunify(L5);
- ?avg15 -> sunify(L15);
+ ?avg1 -> sunify(list_to_float(L1));
+ ?avg5 -> sunify(list_to_float(L5));
+ ?avg15 -> sunify(list_to_float(L15));
?ping -> 4711;
?nprocs ->
Ps = os:cmd("/bin/ps -ax | /usr/bin/wc -l"),
Post generated using Mail2Forum (http://m2f.sourceforge.net) |
|
|
| Back to top |
|
| Combo |
Posted: Tue Apr 10, 2007 6:11 pm |
|
|
|
Guest
|
|
| Back to top |
|
|
|
All times are GMT
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum
|
|
|