[collectd] JVM statistics collection?

Florian Forster octo at verplant.org
Fri Jan 30 14:07:36 CET 2009


Hi Justo,

sorry that it takes three months for me to take a look at your code :(

On Wed, Oct 15, 2008 at 01:31:26PM +0200, Justo Alonso wrote:
> at the end ... I have a operational jmx plugin to collect jvm
> statistics. Please, someone can check it ??

I'm currently in the process of merging your changes to the master
branch, and I have some questions and comments ;)

 - First off, your code looks very clean and readable and the documenta-
   tion is comprehensive, thanks :)

 - The .java files in contrib/java/ don't have a license / copyright
   header. Could you add that or tell me under which license you're
   providing that code? Sebastian and I usually use GPLv2 for our code,
   but any GPL compatible license will do..

 - Speaking of contrib/: I'll most likely put the .java files under
   bindings/java/ and integrate them in the global build system. Or are
   there any issues I'm not aware of?

 - In the .java files you're using one Java 1.6 specific methods in two
   places:

     octo at huhu:~/collectd/contrib/java $ javac -Xlint:unchecked org/collectd/jmx/*.java
     org/collectd/jmx/JMXCollectdMemoryData.java:60: cannot find symbol
     symbol  : method asList()
     location: class javax.management.AttributeList
           for (Attribute at : al.asList()) {
                                 ^
   I tried to use the .iterator() method instead, but failed because I
   don't know Java very well, the generics syntax is somehow weird and
   Java even warns when I put an explicit cast there:
     
     octo at huhu:~/collectd/contrib/java $ javac -Xlint:unchecked org/collectd/jmx/*.java
     org/collectd/jmx/JMXCollectdThreadsData.java:60: warning: [unchecked] unchecked cast
     found   : java.util.Iterator
     required: java.util.Iterator<javax.management.Attribute>
           Iterator<Attribute> iter = (Iterator<Attribute>) al.iterator ();
                                                                        ^
   Do you know how to fix this? I'm lost ;)

Regards,
-octo
-- 
Florian octo Forster
Hacker in training
GnuPG: 0x91523C3D
http://verplant.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20090130/65c59cc1/attachment.pgp 


More information about the collectd mailing list