K2InformaticsGmbH / imem

Clustered in-memory database based on MNESIA with simple SQL layer
http://www.k2informatics.ch/
Apache License 2.0
21 stars 4 forks source link

on demand cluster snapshotting API #285

Closed c-bik closed 5 years ago

c-bik commented 5 years ago

fixes #283

Sample script to create large tables

f(Chars).
Chars = lists:seq($0, $z).
f(Tables).
Tables = [list_to_atom("test"++integer_to_list(I)) || I <- lists:seq(1,10)].
lists:foreach(fun(T) ->
    spawn(fun() ->
        [begin
            Data = << <<(lists:nth(rand:uniform(length(Chars)), Chars))>> || _ <- lists:seq(1, 500 + rand:uniform(500)) >>,
            imem_meta:dirty_write(T, {T, Idx, Data}),
            if Idx rem 100 == 0 -> io:format("~p written ~p~n", [T, Idx]); true -> ok end
        end || Idx <- lists:seq(1, 1000000)]
    end)
end, Tables).