NICTA / stateline

Distributed Markov Chain Monte Carlo
Other
28 stars 11 forks source link

Add REST API #62

Closed darrnshn closed 8 years ago

darrnshn commented 8 years ago

Adds a RESTful API for stateline and a frontend for real time visualisation. #37

This patch:

This is only an initial iteration. Currently not that much information is shown and the dashboard could have some more features like filtering in the future.

darrnshn commented 8 years ago

@AlistaiReid So getting the worker information doesn't look so nice anymore. The delegator (where the worker information are stored) and the Api server runs on different threads. The delegator is not thread safe, so the only way to avoid a race condition is to add a mutex into the delegator. This means that the delegator has to get locks every time it wants to update worker information like queuing times, which obvious degrades performance. The same problem exists even if we're using with the old table logger.

Another way around it would be to limit the type of information we can get from workers. For instance, if we only get worker count, then we only need to obtain locks if a worker connected/disconnected. But this means we can't get cool information like queuing times etc.

What are your thoughts? Is the performance penalty of locks worth it? Or should we ditch cool information?