anchor.diff:  %   limitations under the License.
   
   %% @author Ufuk Celebi <celebi@zib.de>
  -%% @doc Auto-scaling service.
  +%% @doc Auto-scaling service. 
   %% @end
   %% @version $Id$
   -module(autoscale).
  
positive.code:             [{api_tx, 'req_list', Data}] -> Data
          end,
      History = get_opt_field(Alarm, history, 1),
      [Hd|Tail] = lists:map(fun({_, V}) -> get_breach_state(V, Alarm) end, lists:sublist(AvgMsD, History)),
      ?IIF(lists:all(fun(X) -> X =:= Hd end, Tail), Hd, ok);
  check_alarm(random_churn, _Alarm) ->
      case randoms:rand_uniform(1,4) of
  
negative.code:         case {IsLeader, IsNewLeader} of
              {false, true} ->
                  dict:map(fun(Name, {Alarm, Epoch}) ->
                               case Alarm#alarm.state =:= active of                                     
                                   true ->
                                       continue_alarm(Name, Alarm#alarm.period_secs,
                                                      self(), Epoch+1);
                                   false ->
                                       ok
                               end,
                               {Alarm, Epoch+1}
                           end, Alarms);
              {_, _}        -> Alarms
          end,
  