mirror of
https://github.com/valitydev/riak_test.git
synced 2024-11-06 00:25:22 +00:00
- adjust gitignore
- make sure that the results dir is created - ruggedize observer listen socket creation - fix support for non-cuttlefish builds - observer disk autodetection
This commit is contained in:
parent
1180eccdfc
commit
acefade354
2
.gitignore
vendored
2
.gitignore
vendored
@ -16,4 +16,4 @@ doc/
|
||||
coverage
|
||||
tags
|
||||
riak-*
|
||||
results/
|
||||
*.png
|
||||
|
5
results/.gitignore
vendored
Normal file
5
results/.gitignore
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
# Ignore everything in this directory
|
||||
*
|
||||
# Except this file
|
||||
!.gitignore
|
||||
|
@ -32,15 +32,22 @@ watch(Nodes, Collector) ->
|
||||
Pid.
|
||||
|
||||
watcher(Master, Nodes, {_Host, Port, _Dir} = Collector) ->
|
||||
{ok, LSock} = gen_tcp:listen(Port, [{active, false}, binary, {packet, 2}]),
|
||||
case gen_tcp:listen(Port, [{active, false}, binary,
|
||||
{packet, 2}]) of
|
||||
{ok, LSock} ->
|
||||
Acceptor = spawn_link(?MODULE, lloop, [self(), LSock]),
|
||||
monitor(process, Master),
|
||||
Probes = [{Node, undefined} || Node <- Nodes],
|
||||
W = #watcher{nodes=Nodes,
|
||||
acceptor=Acceptor,
|
||||
acceptor={Acceptor, LSock},
|
||||
collector=Collector,
|
||||
probes=Probes},
|
||||
watcher_loop(W).
|
||||
watcher_loop(W);
|
||||
{error, eaddrinuse} ->
|
||||
timer:sleep(100),
|
||||
watcher(Master, Nodes, Collector)
|
||||
%% case_clause other errors
|
||||
end.
|
||||
|
||||
lloop(Master, LSock) ->
|
||||
{ok, Sock} = gen_tcp:accept(LSock),
|
||||
@ -49,7 +56,7 @@ lloop(Master, LSock) ->
|
||||
lloop(Master, LSock).
|
||||
|
||||
watcher_loop(W=#watcher{probes=Probes,
|
||||
acceptor=Acceptor,
|
||||
acceptor={Acceptor,LSock},
|
||||
collector={_,_,Dir}}) ->
|
||||
Missing = [Node || {Node, undefined} <- Probes],
|
||||
%% io:format("Missing: ~p~n", [Missing]),
|
||||
@ -87,7 +94,12 @@ watcher_loop(W=#watcher{probes=Probes,
|
||||
?MODULE:watcher_loop(W2);
|
||||
stop ->
|
||||
exit(Acceptor),
|
||||
[file:close(FD) || {_Sock, FD} <- get()]
|
||||
gen_tcp:close(LSock),
|
||||
[begin
|
||||
file:close(FD),
|
||||
gen_tcp:close(Sock)
|
||||
end
|
||||
|| {Sock, FD} <- get()]
|
||||
end.
|
||||
|
||||
|
||||
@ -184,16 +196,19 @@ collect(H0) ->
|
||||
{_, P} = report_processes(H),
|
||||
{H2, N} = report_network(H),
|
||||
|
||||
%% this needs to figure out the active disks on its own, or report
|
||||
%% for all disks
|
||||
{H3, D} = report_disk2([{<<"dm-0">>, "dm-0"},
|
||||
{<<"dm-1">>, "dm-1"}], H2),
|
||||
%% H3 = report_disk2([{<<"xvdb">>, "xvdb"},
|
||||
%% {<<"xvdc">>, "xvdc"},
|
||||
%% {<<"raid0">>, "md127"}], H2),
|
||||
DiskList =
|
||||
case get(disks) of
|
||||
undefined ->
|
||||
Disks = determine_disks(),
|
||||
put(disks, Disks),
|
||||
Disks;
|
||||
Disks ->
|
||||
Disks
|
||||
end,
|
||||
|
||||
{H3, D} = report_disk2(DiskList, H2),
|
||||
{_, V} = report_vmstat(H3),
|
||||
{_, M} = report_memory(H3),
|
||||
%% H3 = try report_disk2(H2) catch _:_ -> H2 end,
|
||||
C = report_stats(riak_core_stat, all),
|
||||
R = report_stats(riak_kv_stat, all),
|
||||
Stats0 = L ++ Q ++ P ++ N ++ D ++ V ++ M ++ C ++ R,
|
||||
@ -203,6 +218,26 @@ collect(H0) ->
|
||||
%% catch print_down(Nodes),
|
||||
H3.
|
||||
|
||||
%% this portion is meant to be run inside a VM instance running riak
|
||||
determine_disks() ->
|
||||
DataDir =
|
||||
case application:get_env(riak_kv, storage_backend) of
|
||||
{ok, riak_kv_bitcask_backend} ->
|
||||
{ok, Dir} = application:get_env(bitcask, data_root),
|
||||
Dir;
|
||||
{ok, riak_kv_eleveldb_backend} ->
|
||||
{ok, Dir} = application:get_env(eleveldb, data_root),
|
||||
Dir;
|
||||
_ ->
|
||||
error(unhandled_backend)
|
||||
end,
|
||||
Name0 = os:cmd("basename `df "++DataDir++
|
||||
" | tail -1 | awk '{print $1}'`"),
|
||||
{Name, _} = lists:split(length(Name0)-1, Name0),
|
||||
%% keep the old format just in case we need to extend this later.
|
||||
[{Name, Name}].
|
||||
|
||||
|
||||
report_queues(H) ->
|
||||
Max = lists:max([Len || Pid <- processes(),
|
||||
{message_queue_len, Len} <- [process_info(Pid, message_queue_len)]]),
|
||||
@ -264,8 +299,8 @@ report_disk2(Name, Dev, LastStats, #history{rate=Rate}) ->
|
||||
end,
|
||||
{Stats, Report}.
|
||||
|
||||
append_atoms(Atom, Binary) ->
|
||||
list_to_atom(binary_to_list(Binary) ++
|
||||
append_atoms(Atom, List) ->
|
||||
list_to_atom(List ++
|
||||
"_" ++ atom_to_list(Atom)).
|
||||
|
||||
report_memory(H) ->
|
||||
|
@ -29,7 +29,7 @@ bench(Config, NodeList, TestName, Runners, Drop) ->
|
||||
_ -> ok
|
||||
end,
|
||||
|
||||
%% make a local config file, to be copied to a remote
|
||||
%% make a lxoocal config file, to be copied to a remote
|
||||
%% loadgen. They're named separately because for simplicity, we
|
||||
%% use network operations even for local load generation
|
||||
|
||||
@ -48,7 +48,7 @@ bench(Config, NodeList, TestName, Runners, Drop) ->
|
||||
BBDir = rt_config:get(basho_bench),
|
||||
GenList =
|
||||
[begin
|
||||
G = lists:nth((C rem 2), LoadGens),
|
||||
G = lists:nth(C, LoadGens),
|
||||
{G, C}
|
||||
end
|
||||
|| C <- lists:seq(1, Runners)],
|
||||
@ -70,7 +70,8 @@ bench(Config, NodeList, TestName, Runners, Drop) ->
|
||||
lager:info("Spawning remote basho_bench w/ ~p on ~p",
|
||||
[Cmd, LG]),
|
||||
{0, R} = rtssh:ssh_cmd(LG, Cmd, false),
|
||||
lager:info("bench run finished, returned ~p", [R]),
|
||||
lager:info("bench run finished, on ~p returned ~p",
|
||||
[LG, R]),
|
||||
{0, _} = rtssh:ssh_cmd(LG, "rm -r "++BBTmp++"/"),
|
||||
Owner ! {done, ok}
|
||||
catch
|
||||
|
@ -237,7 +237,7 @@ deploy_nodes(NodeConfig, Hosts) ->
|
||||
lists:zip(lists:zip(Nodes, Hosts), Configs)),
|
||||
timer:sleep(500),
|
||||
|
||||
case rt_config:get(cuttle, true) of
|
||||
case rt_config:get(perf_cuttle, true) of
|
||||
false ->
|
||||
rt:pmap(fun({Node, Host}) ->
|
||||
Config = [{riak_api,
|
||||
@ -391,11 +391,11 @@ maybe_prepop(Hosts, BinSize, SetSize) ->
|
||||
|
||||
%% drop the cache
|
||||
rt_bench:bench(PrepopConfig, Hosts, PrepopName,
|
||||
length(rt_config:get(perf_loadgens, [1])), true),
|
||||
1, true),
|
||||
|
||||
timer:sleep(timer:minutes(1)+timer:seconds(30)),
|
||||
stop_data_collectors(PPids),
|
||||
collect_test_data(Hosts, PrepopName);
|
||||
collect_test_data(Hosts, PrepopName),
|
||||
timer:sleep(timer:minutes(1)+timer:seconds(30));
|
||||
false ->
|
||||
ok
|
||||
end.
|
||||
@ -423,7 +423,7 @@ standard_config(NodeCount) ->
|
||||
|
||||
standard_config(NodeCount, AAE) ->
|
||||
Backend = rt_config:get(rt_backend, undefined),
|
||||
Fish = rt_config:get(cuttle, true),
|
||||
Fish = rt_config:get(perf_cuttle, true),
|
||||
RingSize = rt:nearest_ringsize(NodeCount),
|
||||
mk_std_conf(Backend, Fish, RingSize, AAE).
|
||||
|
||||
@ -468,8 +468,8 @@ mk_std_conf(riak_kv_eleveldb_backend, true, Ring, AAE0) ->
|
||||
]};
|
||||
mk_std_conf(_, false, Ring, AAE) ->
|
||||
[{riak_core,
|
||||
{handoff_concurrency, 16},
|
||||
[{ring_creation_size, Ring}]},
|
||||
[{handoff_concurrency, 16},
|
||||
{ring_creation_size, Ring}]},
|
||||
{riak_kv,
|
||||
[{anti_entropy,{AAE, []}}]}
|
||||
];
|
||||
|
Loading…
Reference in New Issue
Block a user