Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix basho_bench_driver for leo_object_storage to work with the latest…

… branch
  • Loading branch information...
commit c2d22591e85d6b763bc3045780a8b195a28dffcc 1 parent 1b40d0b
@mocchira mocchira authored
View
25 test/basho_bench_driver_leo_object_storage.erl
@@ -35,11 +35,12 @@
%%
-spec(new(any()) ->
ok).
-new(_Id) ->
+new(1) ->
Procs = basho_bench_config:get(obj_storage_procs, 64),
Path = basho_bench_config:get(obj_storage_path, "./avs/"),
-
ok = leo_object_storage_api:start([{Procs, Path}]),
+ {ok, null};
+new(_) ->
{ok, null}.
@@ -49,8 +50,8 @@ new(_Id) ->
{ok, any()} | {error, any(), any()}).
run(get, KeyGen, _ValueGen, State) ->
Key = KeyGen(),
- case leo_object_storage_api:get(Key) of
- {ok, _} ->
+ case leo_object_storage_api:get({0, Key}) of
+ {ok, _, _} ->
{ok, State};
not_found ->
{ok, State};
@@ -61,12 +62,22 @@ run(get, KeyGen, _ValueGen, State) ->
run(put, KeyGen, ValueGen, State) ->
Key = KeyGen(),
Val = ValueGen(),
- Pool = leo_object_storage_pool:new(#object{key = Key,
- data = Val}),
- case leo_object_storage_api:put(Key, Pool) of
+ case put_test_data(Key, Val) of
{ok, _ETag} ->
{ok, State};
{error, Cause} ->
{error, Cause, State}
end.
+put_test_data(Key, Bin) ->
+ Object = #object{method = put,
+ addr_id = 0,
+ key = Key,
+ ksize = byte_size(Key),
+ data = Bin,
+ dsize = byte_size(Bin),
+ checksum = leo_hex:raw_binary_to_integer(crypto:hash(md5, Bin)),
+ timestamp = leo_date:now(),
+ clock = leo_date:clock()
+ },
+ leo_object_storage_api:put({0, Key}, Object).
View
14 test/leo_obj_128k_r8w2.conf
@@ -0,0 +1,14 @@
+{mode, max}.
+{duration, 1000}.
+{concurrent, 64}.
+
+{code_paths, ["deps/bitcask", "deps/leo_object_storage", "deps/leo_backend_db", "deps/leo_commons"]}.
+{driver, basho_bench_driver_leo_object_storage}.
+
+{obj_storage_procs, 8}.
+{obj_storage_path, "./avs"}.
+
+{key_generator, {int_to_bin, {uniform_int, 100000}}}.
+{value_generator, {exponential_bin, 8192, 131072}}.
+{operations, [{get, 8}, {put,2}]}.
+
View
16 test/leo_object_storage_test.config
@@ -1,16 +0,0 @@
-{mode, max}.
-{duration, 1}.
-{concurrent, 40}.
-
-{driver, basho_bench_driver_leo_object_storage}.
-{code_paths, ["deps/leo_object_storage",
- "deps/leo_logger",
- "deps/leo_commons"]}.
-
-{obj_storage_procs, 64}.
-{obj_storage_path, "/avs/"}.
-
-{key_generator, {uniform_int, 1000000}}.
-{value_generator, {fixed_bin, 128}}.
-{operations, [{get, 1}]}.
-
View
11 test/object_storage.config
@@ -1,11 +0,0 @@
-{mode, max}.
-{duration, 10}.
-{concurrent, 1}.
-
-{driver, basho_bench_driver_leo_object_storage}.
-
-{key_generator, {int_to_bin,{uniform_int, 100000}}}.
-{value_generator, {fixed_bin, 16384}}.
-
-{operations, [{put, 1}]}.
-{code_paths, ["deps/leo_object_storage", "deps/leo_commons", "deps/leo_backend_db", "deps/bitcask"]}.
Please sign in to comment.
Something went wrong with that request. Please try again.