public void createZorkaDiagMBean() {
String mbeanName = props.getProperty("zorka.diagnostics.mbean").trim();
MBeanServerRegistry registry = getMBeanServerRegistry();
registry.getOrRegister("java", mbeanName, "Version",
config.stringCfg("zorka.version", "unknown"), "Agent Diagnostics");
for (int i = 0; i < AgentDiagnostics.numCounters(); i++) {
final int counter = i;
registry.getOrRegister("java", mbeanName, AgentDiagnostics.getName(counter),
new ValGetter() {
@Override
public Object get() {
return AgentDiagnostics.get(counter);
}
});
}
registry.getOrRegister("java", mbeanName, "SymbolsCreated",
new AttrGetter(getSymbolRegistry(), "size()"));
registry.getOrRegister("java", mbeanName, "stats", stats);
}