anchor.diff:  
   % 12 bytes = 4 bytes (timestamp) + 8 bytes (value)
   -define(POINT_SIZE, 12).
  +
  +% default write chunk size of 4kb
  +-define(WRITE_CHUNK_SIZE, 4096).
   
   
   -record(metadata, {aggregation, retention, xff, archives}).
  
positive.code: -endif.
  
  
  -export([read_metadata/1,
           aggregation_type/1,
           aggregation_value/1,
           update_point/3]).
  
negative.code:      ?_assertEqual(error, validate_archives([{10, 5}, {60, 3600}]))
      ].
  
  create_and_read_test_() ->
      RunTest = fun(As) ->
                        Fun = fun(File) ->
                                      ok = create(File, As, average, 0.5),
                                      read_metadata(File)
                              end,
                        {ok, Metadata} = with_tempfile(Fun),
                        Archives = lists:map(fun(A) ->
                                                     {A#archive_header.seconds, A#archive_header.points}
                                             end, Metadata#metadata.archives),
                        ?_assertEqual(As, Archives)
                end,
  
      [RunTest([{10, 60}]),
       RunTest([{10, 60}, {60, 600}]),
       RunTest([{10, 60}, {60, 600}, {3600, 168}])
      ].
  
  with_tempfile(Fun) ->
      TempFile = lib:nonl(os:cmd("mktemp")),
      try Fun(TempFile)
          after file:delete(TempFile)
      end.
  
  -endif. % TEST
  