if (ZorkaLogger.isLogLevel(ZorkaLogger.ZSP_ARGPROC)) {
log.debug(ZorkaLogger.ZSP_ARGPROC, "Collecting record: " + record);
}
MethodCallStatistic statistic = cachedStatistic;
if (statistic == null) {
MethodCallStatistics statistics = cachedStatistics;
SpyContext ctx = (SpyContext) record.get(".CTX");
if (statistics == null) {
prefetch(record, ctx);
statistics = statsCacheEnabled ? statsCache.get(ctx) : null;
if (statistics == null) {
String mbeanName = subst(mbeanTemplate, record, ctx, mbeanFlags);
String attrName = subst(attrTemplate, record, ctx, attrFlags);
statistics = registry.getOrRegister(mbsName, mbeanName, attrName,
new MethodCallStatistics(), "Call stats");
if (statsCacheEnabled) {
statsCache.putIfAbsent(ctx, statistics);
}
}
}
String key = statFlags != 0 ? subst(statTemplate, record, ctx, statFlags) : statTemplate;
statistic = statistics.getMethodCallStatistic(key);
}
if (0 != (actions & ACTION_STATS)) {
submit(record, statistic);
}
if (0 != (actions & ACTION_ENTER)) {
statistic.markEnter();
}
if (0 != (actions & ACTION_EXIT)) {
statistic.markExit();
}
return record;
}