zoukankan      html  css  js  c++  java
  • 计算rt

    @Service
    public class AntClientServiceImpl implements AntClientService {
        private static final Logger logger = LoggerFactory.getLogger(AntClientServiceImpl.class);
    
        @Override
        public AntResultDTO<List<ModuleDTO>> buildModule(RemoteModuleQuery query, AntRebuildCallback callback, Object obj) {
            Stopwatch stopwatch = Stopwatch.createStarted();
            AntResultDTO<List<ModuleDTO>> moduleRet = null;
            String status =  "success";
            try {
                moduleRet = AntClient.buildModule(query, VipHomeModuleCallback.INSTANCE, obj);
                if(moduleRet!=null){
                    if(!moduleRet.getSuccess()){
                        status = "Failed";
                    }
                    if(CollectionUtils.isEmpty(moduleRet.getData())){
                        status = "empty";
                    }
                }
    
            }catch(Throwable e){
                status = e.getClass().getSimpleName();
                logger.error(e.getMessage(),e);
                throw e;
            } finally {
                stopwatch.stop();
                logger.info("AntClientLog: rt=[{}] | queryModuleIds = [{}]| status = [{}]", stopwatch.elapsed(TimeUnit.MILLISECONDS), query.getModuleIds(), status);
            }
            return moduleRet;
        }
    }
    import java.util.ArrayList;
    import java.util.List;
    import java.util.Objects;
    import java.util.concurrent.TimeUnit;
    
    import com.google.common.base.Joiner;
    import com.google.common.base.Stopwatch;import org.apache.commons.collections.CollectionUtils;
    import org.springframework.stereotype.Service;
    import org.slf4j.Logger;
    import org.slf4j.LoggerFactory;
    
    
    @Service
    public class AntClientServiceImpl implements AntClientService {
        private static final Logger logger = LoggerFactory.getLogger(AntClientServiceImpl.class);
    
        @Override
        public AntResultDTO<List<ModuleDTO>> buildModule(RemoteModuleQuery query, AntRebuildCallback callback, Object obj) {
            Stopwatch stopwatch = Stopwatch.createStarted();
            AntResultDTO<List<ModuleDTO>> moduleRet = null;
            String status =  "success";
            try {
                moduleRet = AntClient.buildModule(query, VipHomeModuleCallback.INSTANCE, obj);
                if(moduleRet!=null){
                    if(!moduleRet.getSuccess()){
                        status = "Failed";
                    }
                    if(CollectionUtils.isEmpty(moduleRet.getData())){
                        status = "empty";
                    }
                }
    
            }catch(Throwable e){
                status = e.getClass().getSimpleName();
                logger.error(e.getMessage(),e);
                throw e;
            } finally {
                stopwatch.stop();
                SystemInfo systemInfo = ApiContext.getSystemInfo();
                String utdid = "empty";
                if(Objects.nonNull(systemInfo)){
                    utdid = systemInfo.getUtdid();
                }
    
                String moduleIds = "";
                if (CollectionUtils.isNotEmpty(query.getModuleIds())){
                    moduleIds = Joiner.on(",").join(query.getModuleIds());
                }
                logger.info("AntClientLog|{}|{}|{}|{}",
                        stopwatch.elapsed(TimeUnit.MILLISECONDS), moduleIds, status, utdid);
            }
            return moduleRet;
        }
    }
  • 相关阅读:
    火狐flash插件
    centos 安装php ide (eclipse + php 插件)
    编译器的工作过程
    php中调用mysql的存储过程和存储函数
    mysql 高性能
    存储过程/游标/mysql 函数
    php 生成二维码
    frameset,frame应用,常用于后台
    html5 meta头部设置
    CAReplicatorLayer复制Layer和动画, 实现神奇的效果
  • 原文地址:https://www.cnblogs.com/iwangzheng/p/7358262.html
Copyright © 2011-2022 走看看