Ottomata has submitted this change and it was merged.

Change subject: Add metrics that can be applied to most JVMs.
......................................................................


Add metrics that can be applied to most JVMs.

A few of the sections won't apply to all JVMs but jmxtrans
will see that there is nothing there for it and continue
without complaint.

Don't use spaces in the group names and result aliases to
help other tools.

Change-Id: I68f92933557ee4c8bd5c7478d70f8820b4aa26f5
---
A manifests/metrics/jvm.pp
1 file changed, 75 insertions(+), 0 deletions(-)

Approvals:
  Ottomata: Verified; Looks good to me, approved
  jenkins-bot: Verified



diff --git a/manifests/metrics/jvm.pp b/manifests/metrics/jvm.pp
new file mode 100644
index 0000000..d6d8481
--- /dev/null
+++ b/manifests/metrics/jvm.pp
@@ -0,0 +1,75 @@
+# == Define jmxtrans::metrics::jvm
+#
+# Sets up this JVM to be monitored by a jmxtrans node.
+# Note that at present this only really does the right thing with CMS and
+# Parallel GC.
+#
+# == Parameters
+# $title          - host:port of JMX to query (required)
+define jmxtrans::metrics::jvm() {
+    jmxtrans::metrics { "${title}-jvm-metrics":
+        jmx                => "$title",
+        ganglia_group_name => 'jvm_memory',
+        objects            => [
+            {
+                'name'        => 'java.lang:type=Memory',
+                'resultAlias' => 'memory',
+                'attrs'       => {
+                    'HeapMemoryUsage'    => {'units' => 'bytes', 'slope' => 
'both'},
+                    'NonHeapMemoryUsage' => {'units' => 'bytes', 'slope' => 
'both'},
+                }
+            },
+            # Parallel GC
+            {
+                'name'        => 'java.lang:name=PS 
Scavenge,type=GarbageCollector',
+                'resultAlias' => 'garbage_collector_incremental',
+                'attrs'       => {
+                    'CollectionCount' => {'units' => 'GCs', 'slope' => 'both'},
+                    'CollectionTime'  => {'units' => 'milliseconds', 'slope' 
=> 'positive'},
+                }
+            },
+            {
+                'name'        => 'java.lang:name=PS 
MarkSweep,type=GarbageCollector',
+                'resultAlias' => 'garbage_collector_full',
+                'attrs'       => {
+                    'CollectionCount' => {'units' => 'GCs', 'slope' => 'both'},
+                    'CollectionTime'  => {'units' => 'milliseconds', 'slope' 
=> 'positive'},
+                }
+            },
+            # CMS GC
+            {
+                'name'        => 'java.lang:name=ParNew,type=GarbageCollector',
+                'resultAlias' => 'garbage_collector_incremental',
+                'attrs'       => {
+                    'CollectionCount' => {'units' => 'GCs', 'slope' => 'both'},
+                    'CollectionTime'  => {'units' => 'milliseconds', 'slope' 
=> 'positive'},
+                }
+            },
+            {
+                'name'        => 
'java.lang:name=ConcurrentMarkSweep,type=GarbageCollector',
+                'resultAlias' => 'garbage_collector_full',
+                'attrs'       => {
+                    'CollectionCount' => {'units' => 'GCs', 'slope' => 'both'},
+                    'CollectionTime'  => {'units' => 'milliseconds', 'slope' 
=> 'positive'},
+                }
+            },
+            # These only show up for Java 7
+            {
+                'name'        => 'java.nio:name=mapped,type=BufferPool',
+                'resultAlias' => 'buffer_pool_mapped',
+                'attrs'       => {
+                    'MemoryUsed' => {'units' => 'bytes', 'slope' => 'both'},
+                    'Count'      => {'units' => 'buffers', 'slope' => 'both'},
+                }
+            },
+            {
+                'name'        => 'java.nio:name=direct,type=BufferPool',
+                'resultAlias' => 'buffer_pool_direct',
+                'attrs'       => {
+                    'MemoryUsed' => {'units' => 'bytes', 'slope' => 'both'},
+                    'Count'      => {'units' => 'buffers', 'slope' => 'both'},
+                }
+            }
+        ]
+    }
+}

-- 
To view, visit https://gerrit.wikimedia.org/r/72097
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I68f92933557ee4c8bd5c7478d70f8820b4aa26f5
Gerrit-PatchSet: 3
Gerrit-Project: operations/puppet/jmxtrans
Gerrit-Branch: master
Gerrit-Owner: Manybubbles <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: Ottomata <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to