• 计算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;
        }
    }
  • 相关阅读:
    安装 SciPy 和 scikit-learn 升级pip 及pip基本命令表
    js修改:before、:after的内容
    初试Celery
    python中的@
    python去除空格和换行符的方法
    Beautiful 疑问小记
    http://www.oreilly.com/catalog/errataunconfirmed.csp?isbn=9780596529321
    浏览器提示框事件
    从欧几里得距离、向量、皮尔逊系数到http://guessthecorrelation.com/
    win安装NLTK出现的问题
  • 原文地址:https://www.cnblogs.com/iwangzheng/p/7358262.html
Copyright © 2020-2023  润新知