Back to index

munin  2.0.1
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Package Functions
org.munin.plugin.jmx.MemoryTenuredGenUsagePostGC Class Reference
Inheritance diagram for org.munin.plugin.jmx.MemoryTenuredGenUsagePostGC:
Inheritance graph
[legend]
Collaboration diagram for org.munin.plugin.jmx.MemoryTenuredGenUsagePostGC:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 MemoryTenuredGenUsagePostGC (Config config)
String threshold ()
long max ()
long committed ()
long init ()
long used ()
void printConfig (PrintWriter out)
void printValues (PrintWriter out)

Static Public Member Functions

static void main (String args[])

Protected Member Functions

void printGraphConfig (PrintWriter out, String title, String vlabel, String info, String args, boolean update, boolean graph)
void printGraphConfig (PrintWriter out)
void printFieldValue (PrintWriter out, AccessibleObject accessible)
void prepareValues () throws Exception
 WARNING: This method tries to fix the broken index-based access of 1.4 JMX plugins by finding the desired pool by the pool name instead.
MemoryPoolMXBean getMemoryPoolMXBean (LegacyPool pool) throws MalformedObjectNameException, IOException
void prepareMemoryUsage (MemoryPoolMXBean memoryPool, UsageType usageType)
void printFieldsConfig (PrintWriter out)
void printFieldConfig (PrintWriter out, AccessibleObject accessible)
void printFieldConfig (PrintWriter out, String name, String label, String info, String type, String draw, String colour, double min, double max)
String getFieldName (AccessibleObject accessible)
MBeanServerConnection getConnection ()
void printFieldAttribute (PrintWriter out, String fieldName, String attributeName, Object value)

Static Protected Member Functions

static String toFieldName (String name)

Protected Attributes

String threshold
MemoryUsage memoryUsage
final Config config

Static Package Functions

static void runGraph (String[] args)

Detailed Description

Definition at line 7 of file MemoryTenuredGenUsagePostGC.java.


Constructor & Destructor Documentation

Definition at line 9 of file MemoryTenuredGenUsagePostGC.java.

                                                         {
              super(config, LegacyPool.TENURED_GEN, UsageType.POST_GC);
       }

Member Function Documentation

Definition at line 24 of file AbstractMemoryUsageProvider.java.

                               {
              return (memoryUsage == null ? -1 : memoryUsage.getCommitted());
       }
MBeanServerConnection org.munin.plugin.jmx.AbstractGraphsProvider.getConnection ( ) [inline, protected, inherited]

Definition at line 20 of file AbstractGraphsProvider.java.

                                                       {
              if (connection == null) {
                     try {
                            connection = BasicMBeanConnection.get(config);
                     } catch (MalformedURLException e) {
                            throw new IllegalStateException(
                                          "Failed to get MBean Server Connection", e);
                     } catch (IOException e) {
                            throw new IllegalStateException(
                                          "Failed to get MBean Server Connection", e);
                     }
              }
              return connection;
       }

Here is the call graph for this function:

Here is the caller graph for this function:

String org.munin.plugin.jmx.AbstractAnnotationGraphsProvider.getFieldName ( AccessibleObject  accessible) [inline, protected, inherited]

Definition at line 89 of file AbstractAnnotationGraphsProvider.java.

                                                                  {
              String fieldName = accessible.getAnnotation(Field.class).name();
              if (fieldName.length() == 0) {
                     String n;
                     if (accessible instanceof Method) {
                            n = ((Method) accessible).getName();
                     } else if (accessible instanceof java.lang.reflect.Field) {
                            n = ((java.lang.reflect.Field) accessible).getName();
                     } else {
                            throw new IllegalArgumentException(
                                          "AccessibleObject must be a field or a method: "
                                                        + accessible);
                     }
                     fieldName = n.substring(0, 1).toUpperCase() + n.substring(1);
              }
              return fieldName;
       }

Here is the caller graph for this function:

MemoryPoolMXBean org.munin.plugin.jmx.AbstractMemoryPoolProvider.getMemoryPoolMXBean ( LegacyPool  pool) throws MalformedObjectNameException, IOException [inline, protected, inherited]

Definition at line 89 of file AbstractMemoryPoolProvider.java.

                                                                      {
              ObjectName gcName = new ObjectName(
                            ManagementFactory.MEMORY_POOL_MXBEAN_DOMAIN_TYPE + ",*");

              Set<ObjectName> mbeans = getConnection().queryNames(gcName, null);
              for (ObjectName objName : mbeans) {
                     MemoryPoolMXBean gc = ManagementFactory.newPlatformMXBeanProxy(
                                   getConnection(), objName.getCanonicalName(),
                                   MemoryPoolMXBean.class);
                     LegacyPool gcPool = LegacyPool.getLegacyPool(gc.getName());
                     if (gcPool == pool) {
                            return gc;
                     }
              }
              return null;
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 29 of file AbstractMemoryUsageProvider.java.

                          {
              return (memoryUsage == null ? -1 : memoryUsage.getInit());
       }
static void org.munin.plugin.jmx.MemoryTenuredGenUsagePostGC.main ( String  args[]) [inline, static]

Definition at line 13 of file MemoryTenuredGenUsagePostGC.java.

                                              {
              runGraph(args);
       }

Definition at line 19 of file AbstractMemoryUsageProvider.java.

                         {
              return (memoryUsage == null ? -1 : memoryUsage.getMax());
       }
void org.munin.plugin.jmx.AbstractMemoryUsageProvider.prepareMemoryUsage ( MemoryPoolMXBean  memoryPool,
UsageType  usageType 
) [inline, protected, inherited]

Definition at line 38 of file AbstractMemoryUsageProvider.java.

                                                                                           {
              switch (usageType) {
              case USAGE:
                     memoryUsage = memoryPool.getUsage();
                     break;
              case POST_GC:
                     memoryUsage = memoryPool.getCollectionUsage();
                     break;
              case PEAK:
                     memoryUsage = memoryPool.getPeakUsage();
                     break;
              default:
                     throw new IllegalArgumentException("Unknown UsageType: "
                                   + usageType);
              }
       }

Here is the caller graph for this function:

void org.munin.plugin.jmx.AbstractMemoryPoolProvider.prepareValues ( ) throws Exception [inline, protected, virtual, inherited]

WARNING: This method tries to fix the broken index-based access of 1.4 JMX plugins by finding the desired pool by the pool name instead.

While that's an improvement it's still fundamentally broken, as pool names and even their existence is undefined and implementation- as well as configuration-dependent.

A fully correct solution would dynamically create graphs for each pool encountered and not make any assumption. MultigraphMemory is such a fully dynamic implementation and should be preferred.

Implements org.munin.plugin.jmx.AbstractMemoryUsageProvider.

Definition at line 64 of file AbstractMemoryPoolProvider.java.

                                                       {
              MemoryPoolMXBean poolMXBean = getMemoryPoolMXBean(pool);
              prepareMemoryUsage(poolMXBean, usage);
              long thresholdValue;
              try {
                     switch (usage) {
                     case USAGE:
                            thresholdValue = poolMXBean.getUsageThreshold();
                            break;
                     // XXX does it make sense to return this threshold value for
                     // peak usage graphs?
                     case PEAK:
                     case POST_GC:
                            thresholdValue = poolMXBean.getCollectionUsageThreshold();
                            break;
                     default:
                            throw new IllegalArgumentException("Unknown UsageType: "
                                          + usage);
                     }
                     threshold = String.valueOf(thresholdValue);
              } catch (UnsupportedOperationException e) {
                     threshold = "U";
              }
       }

Here is the call graph for this function:

void org.munin.plugin.jmx.AbstractAnnotationGraphsProvider.printConfig ( PrintWriter  out) [inline, virtual, inherited]

Implements org.munin.plugin.jmx.AbstractGraphsProvider.

Definition at line 23 of file AbstractAnnotationGraphsProvider.java.

Here is the call graph for this function:

void org.munin.plugin.jmx.AbstractGraphsProvider.printFieldAttribute ( PrintWriter  out,
String  fieldName,
String  attributeName,
Object  value 
) [inline, protected, inherited]

Definition at line 75 of file AbstractGraphsProvider.java.

                                                         {
              if (value != null) {
                     String stringValue = String.valueOf(value);
                     if (stringValue.length() > 0) {
                            out.println(fieldName + "." + attributeName + " " + value);
                     }
              }
       }

Here is the caller graph for this function:

void org.munin.plugin.jmx.AbstractAnnotationGraphsProvider.printFieldConfig ( PrintWriter  out,
AccessibleObject  accessible 
) [inline, protected, inherited]

Definition at line 46 of file AbstractAnnotationGraphsProvider.java.

                                                                                     {
              Field field = accessible.getAnnotation(Field.class);
              String fieldName = getFieldName(accessible);
              String fieldLabel = field.label();
              if (fieldLabel.length() == 0) {
                     fieldLabel = fieldName;
              }

              printFieldConfig(out, fieldName, fieldLabel, field.info(),
                            field.type(), field.draw(), field.colour(), field.min(), field
                                          .max());
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void org.munin.plugin.jmx.AbstractGraphsProvider.printFieldConfig ( PrintWriter  out,
String  name,
String  label,
String  info,
String  type,
String  draw,
String  colour,
double  min,
double  max 
) [inline, protected, inherited]

Definition at line 59 of file AbstractGraphsProvider.java.

                                 {
              printFieldAttribute(out, name, "label", label);
              printFieldAttribute(out, name, "info", info);
              printFieldAttribute(out, name, "type", type);
              if (!Double.isNaN(min)) {
                     printFieldAttribute(out, name, "min", min);
              }
              if (!Double.isNaN(max)) {
                     printFieldAttribute(out, name, "max", max);
              }
              printFieldAttribute(out, name, "draw", draw);
              printFieldAttribute(out, name, "colour", colour);
       }

Here is the call graph for this function:

void org.munin.plugin.jmx.AbstractAnnotationGraphsProvider.printFieldsConfig ( PrintWriter  out) [inline, protected, inherited]

Reimplemented in org.munin.plugin.jmx.GarbageCollectionInfo.

Definition at line 40 of file AbstractAnnotationGraphsProvider.java.

                                                         {
              for (AccessibleObject accessible : getFieldObjects()) {
                     printFieldConfig(out, accessible);
              }
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void org.munin.plugin.jmx.AbstractMemoryPoolProvider.printFieldValue ( PrintWriter  out,
AccessibleObject  accessible 
) [inline, protected, inherited]

Reimplemented from org.munin.plugin.jmx.AbstractAnnotationGraphsProvider.

Definition at line 49 of file AbstractMemoryPoolProvider.java.

                                                                                    {
              super.printFieldValue(out, accessible);
       }
void org.munin.plugin.jmx.AbstractAnnotationGraphsProvider.printGraphConfig ( PrintWriter  out) [inline, protected, inherited]

Reimplemented in org.munin.plugin.jmx.MemoryPoolUsageProvider.

Definition at line 28 of file AbstractAnnotationGraphsProvider.java.

                                                        {
              Graph graph = getClass().getAnnotation(Graph.class);
              if (graph == null) {
                     throw new IllegalArgumentException(getClass()
                                   + " doesn't have @Graph annotation");
              }
              String graphTitle = "JVM (port " + config.getPort() + ") "
                            + graph.title();
              printGraphConfig(out, graphTitle, graph.vlabel(), graph.info(), graph
                            .args(), graph.update(), graph.graph());
       }

Here is the call graph for this function:

Here is the caller graph for this function:

void org.munin.plugin.jmx.AbstractMemoryPoolProvider.printGraphConfig ( PrintWriter  out,
String  title,
String  vlabel,
String  info,
String  args,
boolean  update,
boolean  graph 
) [inline, protected, inherited]

Reimplemented from org.munin.plugin.jmx.AbstractGraphsProvider.

Definition at line 35 of file AbstractMemoryPoolProvider.java.

                                    {
              String poolName;
              try {
                     poolName = getMemoryPoolMXBean(pool).getName();
              } catch (Exception e) {
                     poolName = "<unknown pool>";
              }
              super.printGraphConfig(out, title, vlabel, info + " (" + poolName
                            + ").", args, update, graph);
       }

Here is the call graph for this function:

void org.munin.plugin.jmx.AbstractAnnotationGraphsProvider.printValues ( PrintWriter  out) [inline, virtual, inherited]

Implements org.munin.plugin.jmx.AbstractGraphsProvider.

Reimplemented in org.munin.plugin.jmx.GarbageCollectionInfo.

Definition at line 123 of file AbstractAnnotationGraphsProvider.java.

                                                {
              try {
                     prepareValues();
              } catch (Exception e) {
                     System.err.println("Failed to prepare values for class "
                                   + getClass() + ": " + e.getMessage());
                     e.printStackTrace();
              }
              for (AccessibleObject accessible : getFieldObjects()) {
                     printFieldValue(out, accessible);
              }
       }

Here is the call graph for this function:

static void org.munin.plugin.jmx.AbstractGraphsProvider.runGraph ( String[]  args) [inline, static, package, inherited]

Definition at line 85 of file AbstractGraphsProvider.java.

                                           {
              String providerClassName = Thread.currentThread().getStackTrace()[2].getClassName();
              Class<? extends AbstractGraphsProvider> providerClass;
              try {
                     providerClass = Class.forName(providerClassName).asSubclass(AbstractGraphsProvider.class);
              } catch (ClassNotFoundException e) {
                     throw new IllegalStateException("Failed to get provider class", e);
              }
              Config config = getConfig(args);
              AbstractGraphsProvider provider = getProvider(providerClass, config);
              runGraph(provider, config, args);
       }

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 30 of file AbstractMemoryPoolProvider.java.

                                 {
              return threshold;
       }

Here is the caller graph for this function:

static String org.munin.plugin.jmx.AbstractGraphsProvider.toFieldName ( String  name) [inline, static, protected, inherited]

Definition at line 147 of file AbstractGraphsProvider.java.

                                                        {
              return name.replaceAll("[^A-Za-z0-9_]", "_");
       }

Here is the caller graph for this function:

Definition at line 34 of file AbstractMemoryUsageProvider.java.

                          {
              return (memoryUsage == null ? -1 : memoryUsage.getUsed());
       }

Member Data Documentation

Definition at line 10 of file AbstractGraphsProvider.java.

Definition at line 9 of file AbstractMemoryUsageProvider.java.

Definition at line 16 of file AbstractMemoryPoolProvider.java.


The documentation for this class was generated from the following file: