anchor.diff:  
   %% External API
   
  +default_find(K, Default, Dict) ->
  +    case dict:find(K, Dict) of
  +        error -> Default;
  +        {ok, Value} -> Value
  +    end.
  +
  +default_find(K, Dict) ->
  +    default_find(K, [], Dict).
  +
   basic_stats(PoolId, BucketId) ->
       Pool = menelaus_web:find_pool_by_id(PoolId),
       Bucket = menelaus_web:find_bucket_by_id(Pool, BucketId),
  
positive.code: %  ...]
  
  get_stats_raw(_PoolId, BucketId, SamplesNum) ->
      dict:to_list(stats_aggregator:get_stats(BucketId, SamplesNum)).
  
  sum_stats_ops(Stats) ->
      sum_stats(["cmd_get", "cmd_set",
  
negative.code:     SamplesInterval = 1000, % A sample every second.
      SamplesNum = 60, % Sixty seconds worth of data.
      Samples = get_stats_raw(PoolId, BucketId, SamplesNum),
      Samples2 = dict:map(fun (t, V) ->
                                  lists:map(fun (A) ->
                                                    misc:time_to_epoch_int(A) * 1000
                                            end, V);
                              (_K, V) -> V
                          end,
                          Samples),
  
      LastSampleTStamp = case default_find(t, Samples2) of
                             [] -> 0;
                             [First | _Rest] -> First
                         end,
  
      Samples3 = dict:store(ops, sum_stats_ops(Samples2), Samples2),
      Samples4 = dict:store(misses,
                            sum_stats(["get_misses",
                                       "incr_misses",
                                       "decr_misses",
                                       "delete_misses",
                                       "cas_misses"],
                                      Samples3),
                           Samples3),
  
      Samples5 = dict:store(updates,
                            sum_stats(["cmd_set",
                                       "incr_hits", "decr_hits", "cas_hits"],
                                      Samples4),
                            Samples4),
  
      Samples6 = dict:store(hit_ratio,
                            lists:zipwith(fun (H,G) ->
                                                  float_round(case catch(H / G) of
                                                                  {'EXIT', _R} -> 0;
                                                                  V -> V
                                                              end)
                                          end,
                                          default_find("get_hits", Samples5),
                                          default_find("cmd_get", Samples5)),
                            Samples5),
  
      Samples7 = dict:to_list(dict:map(fun(t, Vals) -> Vals;
                                          (_K, Vals) -> deltas(Vals)
                                       end,
                                       Samples6)),
      {ok, SamplesInterval, LastSampleTStamp, Samples7}.
  
  % get_stats_raw() returns something like, where lists are sorted
  % with most-recent last.
  %
  % (imagine this as a dict)
  %
  % [{"total_items",[0,0,0,0,0]},
  %  {"curr_items",[0,0,0,0,0]},
  