anchor.diff:  return_histogram_and_timestamp(SSM, imported_files, minute) ->
       prepare(SSM#storage_sync_monitoring.imported_min_hist);
   return_histogram_and_timestamp(SSM, imported_files, hour) ->
  -    prepare(SSM#storage_sync_monitoring.imported_min_hist);
  +    prepare(SSM#storage_sync_monitoring.imported_hour_hist);
   return_histogram_and_timestamp(SSM, imported_files, day) ->
  -    prepare(SSM#storage_sync_monitoring.imported_min_hist);
  +    prepare(SSM#storage_sync_monitoring.imported_day_hist);
   return_histogram_and_timestamp(SSM, updated_files, minute) ->
  -    prepare(SSM#storage_sync_monitoring.imported_min_hist);
  +    prepare(SSM#storage_sync_monitoring.updated_min_hist);
   return_histogram_and_timestamp(SSM, updated_files, hour) ->
  -    prepare(SSM#storage_sync_monitoring.imported_min_hist);
  +    prepare(SSM#storage_sync_monitoring.updated_hour_hist);
   return_histogram_and_timestamp(SSM, updated_files, day) ->
  -    prepare(SSM#storage_sync_monitoring.imported_min_hist);
  +    prepare(SSM#storage_sync_monitoring.updated_day_hist);
   return_histogram_and_timestamp(SSM, deleted_files, minute) ->
  -    prepare(SSM#storage_sync_monitoring.imported_min_hist);
  +    prepare(SSM#storage_sync_monitoring.deleted_min_hist);
   return_histogram_and_timestamp(SSM, deleted_files, hour) ->
  -    prepare(SSM#storage_sync_monitoring.imported_min_hist);
  +    prepare(SSM#storage_sync_monitoring.deleted_hour_hist);
   return_histogram_and_timestamp(SSM, deleted_files, day) ->
  -    prepare(SSM#storage_sync_monitoring.imported_min_hist);
  +    prepare(SSM#storage_sync_monitoring.deleted_day_hist);
   return_histogram_and_timestamp(SSM, queue_length, minute) ->
  -    prepare(SSM#storage_sync_monitoring.imported_min_hist);
  +    prepare(SSM#storage_sync_monitoring.queue_length_min_hist);
   return_histogram_and_timestamp(SSM, queue_length, hour) ->
  -    prepare(SSM#storage_sync_monitoring.imported_min_hist);
  +    prepare(SSM#storage_sync_monitoring.queue_length_hour_hist);
   return_histogram_and_timestamp(SSM, queue_length, day) ->
  -    prepare(SSM#storage_sync_monitoring.imported_min_hist).
  +    prepare(SSM#storage_sync_monitoring.queue_length_day_hist).
   
   %%-------------------------------------------------------------------
   %% @private
  
positive.code: %%-------------------------------------------------------------------
  -spec ensure_created(od_space:id(), storage:id()) -> {ok, doc()} | {error, term()}.
  ensure_created(SpaceId, StorageId) ->
      datastore_model:update(?CTX, id(SpaceId, StorageId), fun(SSM) ->
          {ok, SSM}
      end, new_doc(SpaceId, StorageId)).
  
  %%-------------------------------------------------------------------
  %% @doc
  
negative.code: prepare(Timestamp, Values) ->
      [
          {timestamp, Timestamp},
          {values, lists:reverse(Values)}
      ].
  
  %%%===================================================================
  