Permalink
Browse files

add ets/dets info to vm metrics

  • Loading branch information...
1 parent 889b333 commit a493793e66a06db4c0ebffb9c3398c1b83e0d0a2 @joewilliams joewilliams committed Apr 18, 2012
Showing with 10 additions and 1 deletion.
  1. +10 −1 src/folsom_vm_metrics.erl
View
@@ -29,7 +29,9 @@
get_statistics/0,
get_memory/0,
get_process_info/0,
- get_port_info/0
+ get_port_info/0,
+ get_ets_info/0,
+ get_dets_info/0
]).
%% exported for eunit test
@@ -55,7 +57,11 @@ get_process_info() ->
get_port_info() ->
[{pid_port_fun_to_atom(Port), get_port_info(Port)} || Port <- erlang:ports()].
+get_ets_info() ->
+ [{Tab, get_ets_dets_info(ets, Tab)} || Tab <- ets:all()].
+get_dets_info() ->
+ [{Tab, get_ets_dets_info(dets, Tab)} || Tab <- dets:all()].
% internal functions
@@ -223,6 +229,9 @@ get_socket_sockname(Socket) ->
[]
end.
+get_ets_dets_info(Type, Tab) ->
+ [{Key, pid_port_fun_to_atom(Value)} || {Key, Value} <- Type:info(Tab)].
+
ip_to_binary(Tuple) ->
iolist_to_binary(string:join(lists:map(fun integer_to_list/1, tuple_to_list(Tuple)), ".")).

0 comments on commit a493793

Please sign in to comment.