cassandrajmxcassandra-3.0latencyjolokia

calculate write latency using JMX Metrics


I am trying to understand the jmx metrics which I get from cassandra cluster via jolokia but no success in that,

I have used this jmx api to get the write latency

/read/org.apache.cassandra.metrics:type=Table,keyspace=dummy,scope=dummydata,name=WriteLatency

Please help me in understanding the metrics,not able to get clear explanation from documentation.

Where can I get the value of latency from this metrics in the same way I get using nodetool's tablestats

{'status': 200, 'value': {'RateUnit': 'events/second', 'FiveMinuteRate': 1087.2892929429897, 'Max': 25109.16, '99thPercentile': 88.148, 'Count': 857256, '95thPercentile': 61.214, '98thPercentile': 73.45700000000001, 'MeanRate': 800.769491978301, '999thPercentile': 219.342, 'FifteenMinuteRate': 675.9521666587659, 'Mean': 35.578490977930414, 'StdDev': 133.86544518871287, 'DurationUnit': 'microseconds', 'Min': 11.865, 'OneMinuteRate': 774.2469977163188, '50thPercentile': 29.521, '75thPercentile': 35.425000000000004}, 'timestamp': 1552375557, 'request': {'type': 'read', 'mbean': 'org.apache.cassandra.metrics:keyspace=dummy,name=WriteLatency,scope=dummytable,type=Table'}}

Solution

  • You're getting more detail by reading the metrics via JMX. Here is how the nodetool tablestats output matches the jmx output:

    nodetool tablestats dummykeyspace.dummytable | grep "Local write count" = org.apache.cassandra.metrics:keyspace=dummykeyspace,name=WriteLatency,scope=dummytable,type=Table Count
    
    nodetool tablestats dummykeyspace.dummytable | grep "Local write latency" = org.apache.cassandra.metrics:keyspace=dummykeyspace,name=WriteLatency,scope=dummytable,type=Table Mean
    

    Here is an overview of Cassandra metrics, showing the types of metrics gathered, and which ones are available for each table: https://cassandra.apache.org/doc/latest/operating/metrics.html

    As mentioned on that page, the metrics are managed by the code documented here: https://metrics.dropwizard.io/4.0.0/manual/core.html and is most useful to answer questions about over what length of time metrics are calculated.