Hi Vipin,
The ".size" of the index is the number of records currently stored. It's a Java method on the NBHM object (which is why it has the dot at the start).
The index stores one record for each unique combination of :host and :service that gets inserted into it, and things are inserted into it by calling the index in your config, often like this:
(let [index (index)]
(streams
(where (service #"service of interest")
index)))
There are several reason you might want to put events (and thus their host/service pairs) in the index. The most commons ones for me are:
1. Indexed events can "expire", so you can detect when a host/service stops sending events.
When events expire, they are removed from the index, and thus the measured size will go down.
2. Riemann Dash works by querying the index, so if you run that, you can only visualize things that you put in the index via your config.
3. You can query the index yourself with a Riemann client. I don't make much use of this yet, but I have grand plans!
Hope that helps,
Jarpy.