Calculate increase in queue size


Im monitoring activemq queue data, I would like to have a graph to show may many messages were enqueued since the last check.

I can capture the enqueued number which will always be increasing , but is it possible to take the last doc indexed and calculate the difference and store this number, this way I can then look at trends around number of messages enqueued in a given period.