class AccessStatisticFilter implements Filter {
    private static final String RPC_SERVICE = "rpc_service";

    @Override
    public Response filter(final Caller<?> caller, final Request request) {<FILL_FUNCTION_BODY>}
}

        long start = System.currentTimeMillis();
        AccessStatus accessStatus = AccessStatus.NORMAL;
        final long bizProcessTime;
        Response response = null;

        try {
            response = caller.call(request);
            if (response != null && response.getException() != null) {
                if (ExceptionUtil.isBizException(response.getException())) {
                    accessStatus = AccessStatus.BIZ_EXCEPTION;
                } else {
                    accessStatus = AccessStatus.OTHER_EXCEPTION;
                }
            }
            return response;
        } finally {
            long end = System.currentTimeMillis();

            if (response == null) {
                accessStatus = AccessStatus.OTHER_EXCEPTION;
                bizProcessTime = end - start;
            } else {
                bizProcessTime = response.getProcessTime();
            }

            final String application, module;
            if (caller instanceof Referer) {
                application = request.getAttachments().get(URLParamType.application.getName());
                module = MotanFrameworkUtil.getModuleOrGroup(request.getAttachments(), null);
            } else {
                application = caller.getUrl().getApplication();
                module = MotanFrameworkUtil.getModuleOrGroup(caller.getUrl().getParameters(), null);
            }

            final String statName = caller.getUrl().getProtocol() + MotanConstants.PROTOCOL_SEPARATOR + MotanFrameworkUtil.getGroupMethodString(request);
            final int slowCost = caller.getUrl().getIntParameter(URLParamType.slowThreshold.getName(), URLParamType.slowThreshold.getIntValue());
            final Response finalResponse = response;
            if (caller instanceof Provider) {
                StatsUtil.accessStatistic(statName, APPLICATION_STATISTIC, RPC_SERVICE, end, end - start, bizProcessTime, slowCost, accessStatus);
                if (response instanceof Callbackable) {
                    final AccessStatus finalAccessStatus = accessStatus;
                    ((Callbackable) response).addFinishCallback(() -> {
                        if (request instanceof Traceable && finalResponse instanceof Traceable) {
                            long responseSend = ((Traceable) finalResponse).getTraceableContext().getSendTime();
                            long requestReceive = ((Traceable) request).getTraceableContext().getReceiveTime();
                            StatsUtil.accessStatistic(statName + "_WHOLE", application, module, responseSend, responseSend - requestReceive, bizProcessTime, slowCost, finalAccessStatus);
                        }
                    }, null);
                }
            }
            StatsUtil.accessStatistic(statName, application, module, end, end - start, bizProcessTime, slowCost, accessStatus);
        }
    
<no_super_class>