anchor.diff:  -export([create/1, get/2, update/1, delete/1]).
   -export([authorize/2, data_signature/1]).
   
  --type subject_type() :: space | user.
  --type subject_id() :: undefined | binary().
   -type metric_type() ::
       storage_quota | storage_used |
       data_access | block_access |
  -    remote_transfer |connected_users.
  +    remote_transfer | connected_users.
   -type step() :: '5m' | '1h' | '1d' | '1m'.
  --type format() :: 'json'.
   
   -define(DEFAULT_STEP, <<"5m">>).
   
  
positive.code: get(#op_req{client = Cl, data = Data, gri = #gri{id = SpaceId, aspect = space}}, _) ->
      Metric = binary_to_atom(maps:get(<<"metric">>, Data), utf8),
      Step = binary_to_atom(maps:get(<<"step">>, Data, ?DEFAULT_STEP), utf8),
      get_metric(
          Cl#client.id, SpaceId,
          space, SpaceId,
          undefined, undefined,
          Metric, Step
      );
  
  get(#op_req{client = Cl, data = Data, gri = #gri{id = SpaceId, aspect = {user, UserId}}}, _) ->
      Metric = binary_to_atom(maps:get(<<"metric">>, Data), utf8),
      Step = binary_to_atom(maps:get(<<"step">>, Data, ?DEFAULT_STEP), utf8),
      get_metric(
          Cl#client.id, SpaceId,
          space, SpaceId,
          user, UserId,
          Metric, Step
      );
  
  get(_, _) ->
      ?ERROR_NOT_SUPPORTED.
  
negative.code: 
  
  %% @private
  -spec get_metric(session:id(), od_space:id(), undefined | od_user:id(),
      metric_type(), step()) -> {ok, [maps:map()]} | {error, term()}.
  get_metric(SessionId, SpaceId, UserId, Metric, Step) ->
      case space_logic:get_provider_ids(SessionId, SpaceId) of
          {ok, Providers} ->
              Json = lists:map(fun(ProviderId) ->
                  case get_metric_internal(SpaceId, UserId, Metric, Step, ProviderId) of
                      {ok, Data} ->
                          DecodedJson = json_utils:decode(Data),
                          #{
  