Browse files

TODO: snmp values may be wrong in some cases

SVN Revision: 396
  • Loading branch information...
1 parent e8f0b6a commit 7fdaf775a5bae3b34132eec4858c9c880681d413 @nniclausse nniclausse committed Aug 12, 2004
Showing with 6 additions and 2 deletions.
  1. +6 −2 src/tsunami_controller/ts_os_mon.erl
View
8 src/tsunami_controller/ts_os_mon.erl
@@ -395,7 +395,7 @@ active_host([{Host, erlang}| HostList], State=#state{erlang_pids=PidList}) ->
%%--------------------------------------------------------------------
%% Function: analyse_snmp_data/2
-%% Returns:
+%% Returns: any (send msg to ts_mon)
%%--------------------------------------------------------------------
analyse_snmp_data(Args, Host) ->
analyse_snmp_data(Args, Host, []).
@@ -405,7 +405,11 @@ analyse_snmp_data([],Host, Resp) ->
analyse_snmp_data([#varbind{value='NULL'}| Tail], Host, Stats) ->
analyse_snmp_data(Tail, Host, Stats);
-
+
+%% FIXME: this may not be accurate: if we lost packets (the server is
+%% overloaded), the value will be inconsistent, since we assume a
+%% constant time across samples ($INTERVAL)
+
analyse_snmp_data([#varbind{oid=?SNMP_CPU_RAW_SYSTEM, value=Val}| Tail], Host, Stats) ->
{value, User} = lists:keysearch(?SNMP_CPU_RAW_USER, #varbind.oid, Tail),
Value = Val + User#varbind.value,

0 comments on commit 7fdaf77

Please sign in to comment.