A script to check bitcask keydir sizes

Aphyr aphyr at aphyr.com
Wed Mar 16 15:04:48 EDT 2011


I'm trying to track some basic metrics so we can plan for cluster 
capacity, monitor transfers, etc. Figured this might be of interest to 
other riak admins. Apologies if my erlang is nonidiomatic, I'm still 
learning. :)

#!/usr/bin/env escript
%%! -name riakstatuscheck -setcookie riak

main([]) -> main(["riak at 127.0.0.1"]);
main([Node]) ->
   io:format("~w\n", [
     lists:foldl(
       fun({_VNode, Count}, Sum) -> Sum + Count end,
       0,
       rpc:call(list_to_atom(Node), riak_kv_bitcask_backend, key_counts, [])
     )
   ]).


$ ./riakstatus riak at 127.0.0.1
18729




More information about the riak-users mailing list