Listening for ClusterStateEvents and determining Health?

I'm writing a new ES module for exposing some perf data and thought I could
easily just add a ClusterStateListener and determine from that what the
'health' of the cluster is, but I can't find the best way to do this because
the ClusterState object doesn't expose from what I can tell what the health
is. Plenty of other stuff I can export, but thought the Health value should
be simple.. ?

i'm sure I'm going blind here.

Actually, the health calculation is done externally to the cluster state in the actual cluster health action. Might make sense to move it to be computed on the cluster state itself, need to check that it has all it needs there...
On Friday, January 14, 2011 at 3:03 AM, Paul Smith wrote:

I'm writing a new ES module for exposing some perf data and thought I could easily just add a ClusterStateListener and determine from that what the 'health' of the cluster is, but I can't find the best way to do this because the ClusterState object doesn't expose from what I can tell what the health is. Plenty of other stuff I can export, but thought the Health value should be simple.. ?

i'm sure I'm going blind here.

On 15 January 2011 11:13, Shay Banon shay.banon@elasticsearch.com wrote:

Actually, the health calculation is done externally to the cluster state
in the actual cluster health action. Might make sense to move it to be
computed on the cluster state itself, need to check that it has all it needs
there...

Just as you posted this response I found that Health action (know I
understand more about how the RESt stuff works, which is also good for me).

I've raised Issues · elastic/elasticsearch · GitHub
track this, it would be nice if that logic could be reworked somewhere
and exposed when the ClusterState object is created to broadcast to
listeners.