Right now I’m trying to figure out a really good way to provide introspection functions in a functional language like Erlang. The point is that it is pretty useless to try to fetch internal states of processes since it disturbs the performance to try to fetch it. Think about it… trying to retrieve the internal state of a gen_server while it is heavily loaded.
Preferably you would have some data in an ETS table which you can print out or have a process which is specially for E.g. send update-messages two and then query that instead… but since everything is sending messages to that introspection process then querying it fails under the same argument as querying the first one.
I’m yet to find a “one-solution-almost-fits-all” concerning this, I always find myself either re-inventing ways or re-designing software to support introspection. You don’t realize how important maintenance functionality of software is until you are sitting there at 2-3 in the morning on a live system and a single introspection function gave you just the right information you needed to save your life.
The search goes on (da da dum da dum dum)….