anchor.diff:                             [{t, TStamps2} | _] -> lists:last(TStamps2);
                              _                   -> 0
                          end,
  +    {ok, SamplesInterval, LastSampleTStamp, Samples2}.
  +
  +build_bucket_stats_ops_response(PoolId, BucketId, Params) ->
  +    {ok, SamplesInterval, LastSampleTStamp, Samples2} =
  +        get_stats(PoolId, BucketId, Params),
  +    {struct, [{op, {struct, [{tstamp, LastSampleTStamp},
  +                             {samplesInterval, SamplesInterval}
  +                             | Samples2]}}]}.
  +
  +build_bucket_stats_hks_response(_PoolId, _BucketId, _Params) ->
       {struct, [{hot_keys, [{struct, [{name, <<"product:324:inventory">>},
                                       {gets, 10000},
                                       {bucket, <<"shopping application">>},
  
positive.code:      {evictionsPerSec, 5},
       {cachePercentUsed, 50}].
  
  handle_bucket_stats(PoolId, all, Req) ->
      % TODO: get aggregate stats for all buckets.
      handle_bucket_stats(PoolId, "default", Req);
  
  handle_bucket_stats(PoolId, Id, Req) ->
      Now = java_date(),
      Params = Req:parse_qs(),
      Res = build_bucket_stats_response(PoolId, Id, Params, Now),
      reply_json(Req, Res).
  
  %% Implementation
  
  
negative.code:                           {struct, [{name, <<"user:image:value4">>},
                                      {gets, 10000},
                                      {bucket, <<"chat application">>},
                                      {misses, 100}]}]}]}.
  
  -ifdef(EUNIT).
  
  