hibari / gdss-admin

http://hibari.github.com/hibari-doc/
Other
2 stars 0 forks source link

Add an API function to Chain Monitor to get the current best brick of a chain #3

Open tatsuya6502 opened 11 years ago

tatsuya6502 commented 11 years ago

This item is related to https://github.com/hibari/hibari-doc/issues/13

There will be some time that we want to know the current best brick of a chain for system administration purpose. To achieve this from Erlang code, the code has to call brick_chainmon:calculate_best_first_brick(#state{}). However this function is not exported and also requires knowledge of Chain Monitor's internal #state record.

Instead of simply exposing that function, create another function, which doesn't require the knowledge of internal #state record.

brick_chainmon:calculate_best_brick(chain_name())

Once this function is added, we could add an hibair-admin command to get the best brick.