Skip to content

Instantly share code, notes, and snippets.

View moonpolysoft's full-sized avatar

Cliff Moon moonpolysoft

View GitHub Profile
Result : 5358.796 ±(99.9%) 153.407 ops/ms
Statistics: (min, avg, max) = (5005.239, 5358.796, 5685.753), stdev = 176.664
Confidence interval (99.9%): [5205.389, 5512.203]
12 large eggs, separated
1 cup white sugar
1 cup palm sugar
1 liter bourbon
1q good quality whole milk
1c good quality heavy cream
1c cognac or brandy
3/4c whalers dark rum
pinch of fine salt
open_and_insert_260_test() ->
test_cleanup(),
Tree = lists:foldl(fun(N, Tree) ->
update(lists:concat(["key", N]), lists:concat(["value", N]), Tree)
end, open("/Users/cliff/data/dmerkle", 4096), lists:seq(1,260)),
Hash = hash("value200"),
Hash = find("key200", Tree),
File = Tree#dmerkle.file,
error_logger:info_msg("read ~p ~n", [block_server:read_block(File, 4, 8)]),
block_server:write_block(File, 4, <<8174:64>>),
=INFO REPORT==== 6-Aug-2008::22:35:08 ===
writing <<0,0,15,241>> bytes at 0
=INFO REPORT==== 6-Aug-2008::22:35:08 ===
could not find offset
=INFO REPORT==== 6-Aug-2008::22:35:08 ===
writing <<0,0,0,0,0,0,0,0>> bytes at 4
=INFO REPORT==== 6-Aug-2008::22:35:08 ===
=INFO REPORT==== 6-Aug-2008::22:35:08 ===
writing <<0,0,15,241>> bytes at 0
=INFO REPORT==== 6-Aug-2008::22:35:08 ===
could not find offset
=INFO REPORT==== 6-Aug-2008::22:35:08 ===
writing <<0,0,0,0,0,0,0,0>> bytes at 4
=INFO REPORT==== 6-Aug-2008::22:35:08 ===
This is a bench of dynomite put requests with disk based merkle trees. The ruby client is used with a configurable number of threads. Two servers are used. Time to generate test data is not included.
threads items size servers time
1 500 4096 2 42.0825250148773
2 500 4096 2 21.0988519191742
3 500 4096 2 13.8805010318756
4 500 4096 2 10.7571620941162
1 5000 4096 2 416.328256845474
2 5000 4096 2 207.473428010941
WORKERS=16
$pids = []
while $pids.length >= WORKERS
exited = Process.wait
$pids.delete exited
end
$pids << fork do
yield
end
diff --git a/src/erlang/rabbit/src/rabbit_control.erl b/src/erlang/rabbit/src/rabbit_control.erl
index b02afcb..52fb9b0 100644
--- a/src/erlang/rabbit/src/rabbit_control.erl
+++ b/src/erlang/rabbit/src/rabbit_control.erl
@@ -128,6 +128,11 @@ action(force_reset, Node, []) ->
io:format("Forcefully resetting node ~p ...", [Node]),
call(Node, {rabbit_mnesia, force_reset, []});
+action(stat_all, Node, []) ->
+ Res = call(Node, {rabbit_amqqueue, stat_all, []}),
require 'rlibs/dynomite'
dyn = Dynomite.new(:host => 'localhost', :port => 11222)
dyn.put("mahkey", nil, "mayvalue")
(context, data_items) = dyn.get("mahkey")
puts data_items.inspect
class ScriptNameFix
def call(app)
class << app
def new_call(env)
env["SCRIPT_NAME"] = ""
original_call(env)
end