How does nodetool captures all the metrics about cassandra node

95 views
Skip to first unread message

Kant Kodali

unread,
May 5, 2016, 5:31:29 PM5/5/16
to java-dri...@lists.datastax.com
How does nodetool capture all the metrics about cassandra node? Does cassandra writes all the metrics to some file and nodetool(daemon) will just read off from it?

Bo Finnerup Madsen

unread,
May 6, 2016, 12:49:49 AM5/6/16
to java-dri...@lists.datastax.com

tor. 5. maj 2016 kl. 23.31 skrev Kant Kodali <ka...@peernova.com>:
How does nodetool capture all the metrics about cassandra node? Does cassandra writes all the metrics to some file and nodetool(daemon) will just read off from it?

--
You received this message because you are subscribed to the Google Groups "DataStax Java Driver for Apache Cassandra User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to java-driver-us...@lists.datastax.com.

Kant Kodali

unread,
May 6, 2016, 10:33:16 AM5/6/16
to java-dri...@lists.datastax.com
Hi,

I am still not understanding how these beans work (perhaps I need to take a deep dive). It will be a great help if someone can point out if the metrics are written to a log or table and a daemon reads off from one of them?

Thanks!

Andrew Tolbert

unread,
May 6, 2016, 11:01:02 AM5/6/16
to DataStax Java Driver for Apache Cassandra User Mailing List
Hi Kant,

I am still not understanding how these beans work (perhaps I need to take a deep dive). It will be a great help if someone can point out if the metrics are written to a log or table and a daemon reads off from one of them?

The metrics themselves aren't written anywhere (unless you set up a metrics reporter).  They are all recorded in memory and exposed as JMX beans.   The nodetool command makes the appropriate JMX calls to grab those bean attribute values.  The code for nodetool is in the org.apache.cassandra.tools.nodetool package with Nodetool.java being the point of entry.   For example, the cfstats metrics are accessed via TableStats where you can see it makes the appropriate calls to the mbeans to get the values via NodeProbe.  If you keep code diving, you'll find the origin of the metrics and how they are calculated.

Thanks!
Andy

Kant Kodali

unread,
May 6, 2016, 11:30:44 AM5/6/16
to java-dri...@lists.datastax.com
Hi Andrew,

Isn't it a lot to keep it in memory? or is it a fixed size? if it doesnt write any metrics to a log file or anything? What happens when the node dies and comes back up I can still use nodetool netstats or nodetool cfstats and be able to get back the the right numbers right?

Thanks,
Kant

Kant Kodali

unread,
May 7, 2016, 3:48:25 AM5/7/16
to java-dri...@lists.datastax.com
Hi Andrew,

CFStats reports things like Total space occupied by the table, Estimated number of keys in the table and so on. so if cassandra node dies and comes back up does the nodetool cfstats for say Estimated number of keys will be reported zero? since the metrics are not persisted anywhere?

Thanks,
Kant

On Fri, May 6, 2016 at 8:01 AM, Andrew Tolbert <andrew....@datastax.com> wrote:

Olivier Michallat

unread,
May 9, 2016, 11:02:20 AM5/9/16
to java-dri...@lists.datastax.com
Hi Kant,

On a side note, these questions are not related to the Java driver. The Cassandra users mailing list would be a better place to ask them.

Thanks,

--

Olivier Michallat

Driver & tools engineer, DataStax

Reply all
Reply to author
Forward
0 new messages