In Cassandra each written column has a timestamp which can be accessed using the getClock() method (once pooled from the DB).
I would like to know how many columns got written in the last X minutes (let's say 15 minutes) to Cassandra. I looked at the secondary index pattern but could not find it usable for my needs.
Is there a way of doing that (I don't mind which client - CQL, CLI, Hector etc').
Cassandra exposes a lot of metrics about itself, including request counts and latencies as JMX beans. Run JConsole against one of your Cassandra nodes and find org.apache.cassandra.metrics.ColumnFamily
. Below it in the tree there will be nodes for each table, within each keyspace. Pick the WriteLatency
MBean and look at it's attributes; the FifteenMinuteRate
is the number of write requests per second on average over the last 15 minutes. Count
is the total number of write requests.