Simple question about Counters

35 views
Skip to first unread message

Jimi Riblei

unread,
Mar 21, 2015, 4:39:23 AM3/21/15
to metric...@googlegroups.com

Hello,
I'm starting to use the metrics, and I have a "problem" about counters visualization, in this situation:

MetricRegistry.name("mymetrics", "count1", "")
MetricRegistry.name("mymetrics", "count2", "")

In this way I have two entry as:

-- Counters --------------------------------------------------------------------
mymetrics.count1
             count = 1000000
mymetrics.count2
             count = 2000000

And the same in the JMX console.

So, is there a way to have the metrics like:

-- Counters --------------------------------------------------------------------
mymetrics
             count1 = 1000000
             count2 = 2000000

because I have lot counters and I'd like to have all oh them in one entry.

Thank you.




 

Isuru Perera

unread,
Mar 21, 2015, 10:24:32 AM3/21/15
to metric...@googlegroups.com
Hi Jimi,

MetricRegistry.name is just a helper method to concatenate the string values to form a dotted name. It also ignores null or empty strings.

So, in your example, it will be just "mymetrics.count1" and "mymetrics.count2".

JMX reporter will just display these names and there is no OOB feature to group names in a tree structure. If you need, you can create a new JMXReporter and implement your desired feature.

I hope this helps.

Thanks!

Best Regards,



--
You received this message because you are subscribed to the Google Groups "metrics-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to metrics-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Reply all
Reply to author
Forward
0 new messages