Back to index

munin  2.0.1
MemorythresholdUsageCount.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 = "MemorythresholdUsageCount", vlabel = "count", info = "Returns the number of times that the memory usage has crossed the usage threshold.")
00006 public class MemorythresholdUsageCount extends AbstractAnnotationGraphsProvider {
00007 
00008        public MemorythresholdUsageCount(Config config) {
00009               super(config);
00010        }
00011 
00012        private String[] gcValues;
00013 
00014        @Override
00015        protected void prepareValues() throws Exception {
00016               GetUsageThresholdCount collector = new GetUsageThresholdCount(
00017                             getConnection());
00018               gcValues = collector.GC();
00019        }
00020 
00021        @Field(info = "UsageThresholdCount for Tenured Gen", position = 1)
00022        public String tenuredGen() {
00023               return gcValues[0];
00024        }
00025 
00026        @Field(info = "UsageThresholdCount for Perm Gen", position = 2)
00027        public String permGen() {
00028               return gcValues[1];
00029        }
00030 
00031        public static void main(String args[]) {
00032               runGraph(args);
00033        }
00034 }