Skip to content

Instantly share code, notes, and snippets.

@jbehrends
Last active December 19, 2015 16:48
Show Gist options
  • Select an option

  • Save jbehrends/5986423 to your computer and use it in GitHub Desktop.

Select an option

Save jbehrends/5986423 to your computer and use it in GitHub Desktop.

Revisions

  1. Josh Behrends revised this gist Oct 1, 2013. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion jmxstats.conf
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,6 @@
    LoadPlugin java
    <LoadPlugin java>

    </LoadPlugin>

    <Plugin "java">
    JVMArg "-Djava.class.path=/usr/share/collectd/java/collectd-api.jar:/usr/share/collectd/java/generic-jmx.jar"
  2. Josh Behrends revised this gist Oct 1, 2013. 1 changed file with 22 additions and 22 deletions.
    44 changes: 22 additions & 22 deletions jmxstats.conf
    Original file line number Diff line number Diff line change
    @@ -8,9 +8,9 @@ LoadPlugin java
    # MBean blocks #
    ################
    # Memory usage by memory pool.
    <MBean "memory_pool">
    <MBean "jvm_memory_pool">
    ObjectName "java.lang:type=MemoryPool,*"
    InstancePrefix "memory_pool-"
    InstancePrefix "jvm_memory_pool-"
    InstanceFrom "name"
    <Value>
    Type "memory"
    @@ -21,7 +21,7 @@ LoadPlugin java
    </Value>
    </MBean>
    # Heap memory usage
    <MBean "memory-heap">
    <MBean "jvm_memory-heap">
    ObjectName "java.lang:type=Memory"
    #InstanceFrom ""
    InstancePrefix "memory-heap"
    @@ -35,7 +35,7 @@ LoadPlugin java
    </Value>
    </MBean>
    # Non-heap memory usage
    <MBean "memory_nonheap">
    <MBean "jvm_memory_nonheap">
    ObjectName "java.lang:type=Memory"
    #InstanceFrom ""
    InstancePrefix "memory-nonheap"
    @@ -49,19 +49,19 @@ LoadPlugin java
    </Value>
    </MBean>
    # Jvm thread count
    <MBean "java_threads">
    <MBean "jvm_threads">
    ObjectName "java.lang:type=Threading"
    #InstanceFrom ""
    InstancePrefix "thread_count"
    InstancePrefix "jvm_thread_count"
    <Value>
    Type "threads"
    Attribute "ThreadCount"
    </Value>
    </MBean>
    # Number of classes loaded.
    <MBean "classes">
    <MBean "jvm_classes">
    ObjectName "java.lang:type=ClassLoading"
    InstancePrefix "loaded_classes"
    InstancePrefix "jvm_loaded_classes"
    #InstanceFrom ""
    <Value>
    Type "gauge"
    @@ -72,9 +72,9 @@ LoadPlugin java
    </Value>
    </MBean>
    # Garbage collector stats
    <MBean "garbage_collector">
    <MBean "jvm_garbage_collector">
    ObjectName "java.lang:type=GarbageCollector,*"
    InstancePrefix "gc-"
    InstancePrefix "jvm_gc-"
    InstanceFrom "name"
    <Value>
    Type "invocations"
    @@ -265,12 +265,12 @@ LoadPlugin java
    Host "<%= @hostname %>"
    InstancePrefix "CAS-"
    ServiceURL "service:jmx:rmi:///jndi/rmi://localhost:7199/jmxrmi"
    Collect "memory_pool"
    Collect "memory-heap"
    Collect "memory_nonheap"
    Collect "java_threads"
    Collect "classes"
    Collect "garbage_collector"
    Collect "jvm_memory_pool"
    Collect "jvm_memory-heap"
    Collect "jvm_memory_nonheap"
    Collect "jvm_threads"
    Collect "jvm_classes"
    Collect "jvm_garbage_collector"
    Collect "jvm_uptime"
    Collect "cas_internal"
    Collect "cas_metrics"
    @@ -282,12 +282,12 @@ LoadPlugin java
    Host "<%= @hostname %>"
    InstancePrefix "AMQ-"
    ServiceURL "service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi"
    Collect "memory_pool"
    Collect "memory-heap"
    Collect "memory_nonheap"
    Collect "java_threads"
    Collect "classes"
    Collect "garbage_collector"
    Collect "jvm_memory_pool"
    Collect "jvm_memory-heap"
    Collect "jvm_memory_nonheap"
    Collect "jvm_threads"
    Collect "jvm_classes"
    Collect "jvm_garbage_collector"
    Collect "jvm_uptime"
    </Connection>
    </Plugin>
  3. Josh Behrends created this gist Jul 12, 2013.
    294 changes: 294 additions & 0 deletions jmxstats.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,294 @@
    LoadPlugin java

    <Plugin "java">
    JVMArg "-Djava.class.path=/usr/share/collectd/java/collectd-api.jar:/usr/share/collectd/java/generic-jmx.jar"
    LoadPlugin "org.collectd.java.GenericJMX"
    <Plugin "GenericJMX">
    ################
    # MBean blocks #
    ################
    # Memory usage by memory pool.
    <MBean "memory_pool">
    ObjectName "java.lang:type=MemoryPool,*"
    InstancePrefix "memory_pool-"
    InstanceFrom "name"
    <Value>
    Type "memory"
    #InstancePrefix ""
    #InstanceFrom ""
    Table true
    Attribute "Usage"
    </Value>
    </MBean>
    # Heap memory usage
    <MBean "memory-heap">
    ObjectName "java.lang:type=Memory"
    #InstanceFrom ""
    InstancePrefix "memory-heap"
    # Creates four values: committed, init, max, used
    <Value>
    Type "memory"
    #InstancePrefix ""
    #InstanceFrom ""
    Table true
    Attribute "HeapMemoryUsage"
    </Value>
    </MBean>
    # Non-heap memory usage
    <MBean "memory_nonheap">
    ObjectName "java.lang:type=Memory"
    #InstanceFrom ""
    InstancePrefix "memory-nonheap"
    # Creates four values: committed, init, max, used
    <Value>
    Type "memory"
    #InstancePrefix ""
    #InstanceFrom ""
    Table true
    Attribute "NonHeapMemoryUsage"
    </Value>
    </MBean>
    # Jvm thread count
    <MBean "java_threads">
    ObjectName "java.lang:type=Threading"
    #InstanceFrom ""
    InstancePrefix "thread_count"
    <Value>
    Type "threads"
    Attribute "ThreadCount"
    </Value>
    </MBean>
    # Number of classes loaded.
    <MBean "classes">
    ObjectName "java.lang:type=ClassLoading"
    InstancePrefix "loaded_classes"
    #InstanceFrom ""
    <Value>
    Type "gauge"
    InstancePrefix "loaded_classes"
    #InstanceFrom ""
    Table false
    Attribute "LoadedClassCount"
    </Value>
    </MBean>
    # Garbage collector stats
    <MBean "garbage_collector">
    ObjectName "java.lang:type=GarbageCollector,*"
    InstancePrefix "gc-"
    InstanceFrom "name"
    <Value>
    Type "invocations"
    InstancePrefix "collection_count"
    #InstanceFrom ""
    Table false
    Attribute "CollectionCount"
    </Value>
    <Value>
    Type "total_time_in_ms"
    InstancePrefix "collection_time"
    #InstanceFrom ""
    Table false
    Attribute "CollectionTime"
    </Value>
    </MBean>
    # JVM uptime
    <MBean "jvm_uptime">
    ObjectName "java.lang:type=Runtime"
    InstancePrefix "jvm_uptime"
    <Value>
    Type "uptime"
    Attribute "Uptime"
    </Value>
    </MBean>
    # Cassandra specific MBeans
    # org.apache.cassandra.internal metrics
    <MBean "cas_internal">
    ObjectName "org.apache.cassandra.internal:type=*"
    #InstancePrefix ""
    InstanceFrom "type"
    <Value>
    Type "gauge"
    Attribute "ActiveCount"
    InstancePrefix "activecount"
    </Value>
    <Value>
    Type "gauge"
    Attribute "CompletedTasks"
    InstancePrefix "completedtasks"
    </Value>
    <Value>
    Type "gauge"
    Attribute "CurrentlyBlockedTasks"
    InstancePrefix "currentlyblockedtasks"
    </Value>
    <Value>
    Type "gauge"
    Attribute "PendingTasks"
    InstancePrefix "pendingtasks"
    </Value>
    <Value>
    Type "gauge"
    Attribute "TotalBlockedTasks"
    InstancePrefix "totalblockedtasks"
    </Value>
    </MBean>
    # org.apache.cassandra.metrics metrics
    <MBean "cas_metrics">
    ObjectName "org.apache.cassandra.metrics:type=ClientRequestMetrics,name=*"
    #InstancePrefix ""
    InstanceFrom "name"
    <Value>
    Type "gauge"
    Attribute "Count"
    InstancePrefix "count"
    </Value>
    </MBean>
    <MBean "cas_storageservice">
    ObjectName "org.apache.cassandra.db:type=StorageService"
    #InstancePrefix ""
    InstanceFrom "type"
    <Value>
    Type "gauge"
    Attribute "Load"
    InstancePrefix "load"
    </Value>
    </MBean>
    <MBean "cas_cf_stats">
    ObjectName "org.apache.cassandra.db:type=ColumnFamilies,keyspace=*,columnfamily=*"
    InstancePrefix "CF-"
    InstanceFrom "columnfamily"
    <Value>
    Type "gauge"
    Attribute "BloomFilterDiskSpaceUsed"
    InstancePrefix "bloomfilterdiskspaceused"
    </Value>
    <Value>
    Type "gauge"
    Attribute "BloomFilterFalsePositives"
    InstancePrefix "bloomfilterfalsepositives"
    </Value>
    <Value>
    Type "gauge"
    Attribute "BloomFilterFalseRatio"
    InstancePrefix "bloomfilterfalseratio"
    </Value>
    <Value>
    Type "gauge"
    Attribute "CompressionRatio"
    InstancePrefix "compressionratio"
    </Value>
    <Value>
    Type "gauge"
    Attribute "MaxRowSize"
    InstancePrefix "maxrowsize"
    </Value>
    <Value>
    Type "gauge"
    Attribute "MeanRowSize"
    InstancePrefix "meanrowsize"
    </Value>
    <Value>
    Type "gauge"
    Attribute "MinRowSize"
    InstancePrefix "minrowsize"
    </Value>
    <Value>
    Type "gauge"
    Attribute "ReadCount"
    InstancePrefix "readcount"
    </Value>
    <Value>
    Type "gauge"
    Attribute "WriteCount"
    InstancePrefix "writecount"
    </Value>
    <Value>
    Type "gauge"
    Attribute "RecentBloomFilterFalsePositives"
    InstancePrefix "recentbloomfilterfalsepositives"
    </Value>
    <Value>
    Type "gauge"
    Attribute "RecentBloomFilterFalseRatio"
    InstancePrefix "recentbloomfilterfalseratio"
    </Value>
    <Value>
    Type "gauge"
    Attribute "RecentReadLatencyMicros"
    InstancePrefix "recentreadlatencymicros"
    </Value>
    <Value>
    Type "gauge"
    Attribute "TotalReadLatencyMicros"
    InstancePrefix "totalreadlatencymicros"
    </Value>
    <Value>
    Type "gauge"
    Attribute "RecentWriteLatencyMicros"
    InstancePrefix "recentwritelatencymicros"
    </Value>
    <Value>
    Type "gauge"
    Attribute "TotalWriteLatencyMicros"
    InstancePrefix "totalwritelatencymicros"
    </Value>
    </MBean>
    <MBean "cas_compaction_stats">
    ObjectName "org.apache.cassandra.db:type=CompactionManager"
    InstancePrefix "CompactionManager"
    #InstanceFrom ""
    <Value>
    Type "gauge"
    Attribute "CompletedTasks"
    InstancePrefix "completedtasks"
    </Value>
    <Value>
    Type "gauge"
    Attribute "PendingTasks"
    InstancePrefix "pendingtasks"
    </Value>
    <Value>
    Type "gauge"
    Attribute "TotalCompactionsCompleted"
    InstancePrefix "totalcompactionscompleted"
    </Value>
    <Value>
    Type "gauge"
    Attribute "TotalBytesCompacted"
    InstancePrefix "totalbytescompacted"
    </Value>
    </MBean>
    #######################
    # Connection block(s) #
    #######################
    <Connection>
    Host "<%= @hostname %>"
    InstancePrefix "CAS-"
    ServiceURL "service:jmx:rmi:///jndi/rmi://localhost:7199/jmxrmi"
    Collect "memory_pool"
    Collect "memory-heap"
    Collect "memory_nonheap"
    Collect "java_threads"
    Collect "classes"
    Collect "garbage_collector"
    Collect "jvm_uptime"
    Collect "cas_internal"
    Collect "cas_metrics"
    Collect "cas_storageservice"
    Collect "cas_cf_stats"
    Collect "cas_compaction_stats"
    </Connection>
    <Connection>
    Host "<%= @hostname %>"
    InstancePrefix "AMQ-"
    ServiceURL "service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi"
    Collect "memory_pool"
    Collect "memory-heap"
    Collect "memory_nonheap"
    Collect "java_threads"
    Collect "classes"
    Collect "garbage_collector"
    Collect "jvm_uptime"
    </Connection>
    </Plugin>
    </Plugin>