anchor.diff:      
       % Do a data merge.
       #state{extent_1 = Extent1, extent_2 = Extent2, extent_3 = Extent3} = State,
  -    Met1 = metric_name(Metric, "/1"),
  -    State1 = merge_data(Met1, Ts, Value, ?INTERVAL_1, Extent1, State),
  -    Met2 = metric_name(Metric, "/2"),
  -    State2 = merge_data(Met2, Ts, Value, ?INTERVAL_2, Extent2, State1),
  -    Met3 = metric_name(Metric, "/3"),
  -    State3 = merge_data(Met3, Ts, Value, ?INTERVAL_3, Extent3, State2),
  +    State1 = merge_data(Metric, Ts, Value, ?INTERVAL_1, Extent1, State),
  +    State2 = merge_data(Metric, Ts, Value, ?INTERVAL_2, Extent2, State1),
  +    State3 = merge_data(Metric, Ts, Value, ?INTERVAL_3, Extent3, State2),
   
       {reply, ok, State3}.
   
   merge_data(Met, Ts, Value, Interval, Extent, State) ->
  +    Metric = metric_name(Met, Interval),
  +    {[Start, _End], NewState} = 
  +        case time_extent(Ts, Interval) of
  +            Extent ->
  +                {Extent, State};
  +            Other  ->
  +                NState = 
  +                case Interval of
  +                    ?INTERVAL_1 -> State#state{extent_1 = Other};
  +                    ?INTERVAL_2 -> State#state{extent_2 = Other};
  +                    ?INTERVAL_3 -> State#state{extent_3 = Other}
  +                end,
  +                {Other, NState}
  +        end,
  +    update_met(Metric, Start, Value),
  +    NewState.
  +
  +update_met(Met, Key, Value) ->
       open_table(Met),
  -    case time_extent(Ts, Interval) of
  -        [Start, _End] = Extent ->
  -            update_met(Met, Start, Value),
  -            State;
  -        [Start, _End] = Other  ->
  -            update_met(Met, Start, Value),
  -            case Interval of
  -                ?INTERVAL_1 -> State#state{extent_1 = Other};
  -                ?INTERVAL_2 -> State#state{extent_2 = Other};
  -                ?INTERVAL_3 -> State#state{extent_3 = Other}
  -            end
  -    end.
  -
  -update_met(Met, Key, Value) ->
       case dets:lookup(Met, Key) of
           [] -> dets:insert(Met, {Key, Value});
           _  -> dets:update_counter(Met, Key, {2, Value})
  
positive.code: 
  %% Access to specify minutes metric data recently.
  get_data(Met, Minutes, Interval) ->
      Metric = case Interval of
                  ?INTERVAL_1 -> metric_name(Met, "/1");
                  ?INTERVAL_2 -> metric_name(Met, "/2");
                  ?INTERVAL_3 -> metric_name(Met, "/3");
                  ?REPORT_INTERVAL -> Met
               end,
      
      open_table(Metric),
      TotalNum = dets:info(Metric, size),
  
negative.code:         [] -> {Met, [[{x, Start}, {y, 0}], [{x, End}, {y, 0}]]}
      end.
  
  metric_name(Met, Interval) ->
      case Interval of
          ?INTERVAL_1 ->
              list_to_atom(atom_to_list(Met) ++ "/1");
          ?INTERVAL_2 ->
              list_to_atom(atom_to_list(Met) ++ "/2");
          ?INTERVAL_3 ->
              list_to_atom(atom_to_list(Met) ++ "/3");
          ?REPORT_INTERVAL -> Met
      end.
  
  %% Save the Metric data, and do a merge.
  save_data(Metric, Ts, Value) ->
  