Back to index

munin  2.0.1
MemorythresholdPostGCCount.java
Go to the documentation of this file.
00001 package org.munin.plugin.jmx;
00002 
00003 import org.munin.plugin.jmx.AbstractAnnotationGraphsProvider.Graph;
00004 
00005 @Graph(title = "MemorythresholdPostGCCount", vlabel = "count", info = "Returns the number of times that the Java virtual machine has detected that the memory usage has reached or exceeded the collection usage threshold.")
00006 public class MemorythresholdPostGCCount extends
00007               AbstractAnnotationGraphsProvider {
00008 
00009        public MemorythresholdPostGCCount(Config config) {
00010               super(config);
00011        }
00012 
00013        private long[] gcValues;
00014 
00015        @Override
00016        protected void prepareValues() throws Exception {
00017               GetMemoryPoolThresholdCount collector = new GetMemoryPoolThresholdCount(
00018                             getConnection());
00019               gcValues = collector.GC();
00020        }
00021 
00022        @Field(info = "ThresholdCount for Tenured Gen", position = 1)
00023        public long tenuredGen() {
00024               return gcValues[0];
00025        }
00026 
00027        @Field(info = "ThresholdCount for Perm Gen", position = 2)
00028        public long permGen() {
00029               return gcValues[1];
00030        }
00031 
00032        @Field(info = "Thresholdcount for Eden", position = 3)
00033        public long eden() {
00034               return gcValues[2];
00035        }
00036 
00037        @Field(info = "Thresholdcount for Survivor", position = 4)
00038        public long survivor() {
00039               return gcValues[3];
00040        }
00041 
00042        public static void main(String args[]) {
00043               runGraph(args);
00044        }
00045 }