Collectd.registerShutdown ("JMXMemory", this);
}
private void submit (String plugin_instance, MemoryUsage usage) /* {{{ */
{
ValueList vl;
long mem_init;
long mem_used;
long mem_committed;
long mem_max;
mem_init = usage.getInit ();
mem_used = usage.getUsed ();
mem_committed = usage.getCommitted ();
mem_max = usage.getMax ();
Collectd.logDebug ("JMXMemory plugin: plugin_instance = " + plugin_instance + "; "
+ "mem_init = " + mem_init + "; "
+ "mem_used = " + mem_used + "; "
+ "mem_committed = " + mem_committed + "; "
+ "mem_max = " + mem_max + ";");
vl = new ValueList ();
vl.setHost ("localhost");
vl.setPlugin ("JMXMemory");
vl.setPluginInstance (plugin_instance);
vl.setType ("memory");
if (mem_init >= 0)
{
vl.addValue (mem_init);
vl.setTypeInstance ("init");
Collectd.dispatchValues (vl);
vl.clearValues ();
}
if (mem_used >= 0)
{
vl.addValue (mem_used);
vl.setTypeInstance ("used");
Collectd.dispatchValues (vl);
vl.clearValues ();
}
if (mem_committed >= 0)
{
vl.addValue (mem_committed);
vl.setTypeInstance ("committed");
Collectd.dispatchValues (vl);
vl.clearValues ();
}
if (mem_max >= 0)
{
vl.addValue (mem_max);
vl.setTypeInstance ("max");
Collectd.dispatchValues (vl);
vl.clearValues ();
}
} /* }}} void submit */