I have a supervisor (called alice) which starts a bunch of_one_for_one workers. Now I'd like to get some info about all of the works together. For instance, let's say workers are TCP servers and I'd like to get all port numbers used by workers, or all remote addresses which are connected to those workers. Where should I put this functionality?
Supervisor doesn't have gen_server functionality and cannot answer calls. So, it seems to me, the most reasonable way is to have another supervisor (called bob) which spawns supervisor alice and another gen_server (charile) which implements calls like {get, ports_used_by_alices_workers} by calling supervisor:which_children(alice) and then asking each alice's child for it's port. So, charile is alice's sibling and answers calls about alice's children. Is that OK? Or is there a more elegant way of doing this?