Erlang Mailing Lists

Author Message

<  Erlang patches mailing list  ~  OS X os_mon broken

sean
Posted: Mon Mar 07, 2005 10:05 pm Reply with quote
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)
View user's profile Send private message
Combo
Posted: Tue Apr 10, 2007 6:11 pm Reply with quote
Guest
Carmen Electra Giving A Head And Taking A Load!
http://Carmen-Electra-Giving-A-Head-And-Taking-A-Load.org/WindowsMediaPlayer.php?movie=231891

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

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