I sometimes get mnesia overloaded
error message while using primarily async_dirty
queries and ram_copies
tables. So to understand what is going on I want to get more information about mnesia state such as number of queries per second or the size of query queue. I've searched a lot and found two probable approaches.
The first is mnesia:system_info
function that can return a list of current transactions. But it seems not able to provide an information about non-transactional queries.
The second is subscribing to mnesia events, but using this way some active background processing is needed as well as manual subscribing to each table events.
Are there better ways of getting this information?
Mnesia is centered around the idea of using a record to define a table's structure. Each table can thus store a bunch of similar records, and anything that goes in a record can thus be stored in a Mnesia table, including atoms, pids, references, and so on.
Mnesia is a distributed, soft real-time database management system written in the Erlang programming language. It is distributed as part of the Open Telecom Platform.
Mnesia is a truly distributed DBMS and the schema is a system table that is replicated on all nodes in a Mnesia system. This function fails if a schema is already present on any of the nodes in NodeList.
I know this isn't the most direct answer, and I'm not as familiar with the code as I was four years ago, but I once had the same question and made an erlang app that monitors mnesia write statistics serves an SVG graph of throughput:
Mnesia Graphs
If it's sort of something you want, the tests exercise the functionality: https://github.com/woahdae/mnesia_graphs/blob/master/test/mnesia_graphs_srv_tests.erl
If it's really something you want, I could take a second look at the project. I'm working in Erlang again, so it's a good exercise.
Also, yet another reminder of who a good README is for: yourself, four years later!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With