long init = 0;
IRPCCallProcessor proc = getProcessor(arg1);
try {
try {
ApiStats apiStats = ApiStats.get(ApiProxy
.getCurrentEnvironment());
if (apiStats != null) {
init = apiStats.getApiTimeInMegaCycles();
}
} catch (Throwable e) {
e.printStackTrace();
}
if (proc != null) {
proc.preCall(arg2, arg3);
}
byte[] makeSyncCall = delegate.makeSyncCall(arg0, arg1, arg2, arg3);
if (proc != null) {
proc.postCall(arg2, makeSyncCall);
}
return makeSyncCall;
} catch (Throwable e) {
e.printStackTrace();
return null;
} finally {
try {
ApiStats apiStats = ApiStats.get(ApiProxy
.getCurrentEnvironment());
if (apiStats != null) {
long tl = apiStats.getApiTimeInMegaCycles();
int delta = (int) (tl - init);
if (proc != null) {
proc.stat(delta);
}
Profiler.incCPU(delta);