List<MethodStats> allMethodStats = new ArrayList<MethodStats>();
Configuration pluginConfig = getResourceContext().getPluginConfiguration();
String propName = pluginConfig.getSimple("invocationStatsPropertyName").getStringValue();
ManagedProperty detypedInvokedStatsProp = managedComponent.getProperty(propName);
invocationStats.endTime = System.currentTimeMillis();
CompositeValue detypedInvokeStatsMetaValue = (CompositeValue) detypedInvokedStatsProp.getValue();
CompositeValue allMethodStatsMetaValue = (CompositeValue) detypedInvokeStatsMetaValue.get("methodStats");
Set<String> methodNames = allMethodStatsMetaValue.getMetaType().keySet();
for (String methodName : methodNames) {
CompositeValue methodStatsMetaValue = (CompositeValue) allMethodStatsMetaValue.get(methodName);
MethodStats methodStats = new MethodStats();
methodStats.name = methodName;
methodStats.count = Long.parseLong(((SimpleValue) methodStatsMetaValue.get("count")).getValue().toString());
methodStats.totalTime = Long.parseLong(((SimpleValue) methodStatsMetaValue.get("totalTime")).getValue()
.toString());
methodStats.minTime = Long.parseLong(((SimpleValue) methodStatsMetaValue.get("minTime")).getValue()
.toString());
methodStats.maxTime = Long.parseLong(((SimpleValue) methodStatsMetaValue.get("maxTime")).getValue()
.toString());
allMethodStats.add(methodStats);
}
invocationStats.methodStats = allMethodStats;