Package org.apdplat.module.monitor.model

Examples of org.apdplat.module.monitor.model.RuningTime


        }
        Collections.sort(models, new Comparator(){

            @Override
            public int compare(Object o1, Object o2) {
                RuningTime p1=(RuningTime)o1;
                RuningTime p2=(RuningTime)o2;
                return (int) (p1.getStartupTime().getTime()-p2.getStartupTime().getTime());
            }
       
        });
        for(int i=0;i<models.size();){
            RuningTime item = models.get(i);
            String key=DateTypeConverter.toDefaultDateTime(item.getStartupTime())+", 运行"+item.getRuningTimeStr();
            data.put(key, item.getRuningTime());
            i++;
            if(i<models.size()){
                RuningTime item2 = models.get(i);
                long stop=item2.getStartupTime().getTime()-item.getShutdownTime().getTime();
                key=DateTypeConverter.toDefaultDateTime(item.getShutdownTime())+", 停机"+ConvertUtils.getTimeDes(stop);
                data.put(key, -stop);
            }
        }
       
View Full Code Here


        }
        Collections.sort(models, new Comparator(){

            @Override
            public int compare(Object o1, Object o2) {
                RuningTime p1=(RuningTime)o1;
                RuningTime p2=(RuningTime)o2;
                return (int) (p1.getStartupTime().getTime()-p2.getStartupTime().getTime());
            }
       
        });
        RuningTime first=models.get(0);
        RuningTime latest=models.get(models.size()-1);
        LOG.debug("系统首次启动时间:"+DateTypeConverter.toDefaultDateTime(first.getStartupTime()));
        LOG.debug("系统最后关闭时间:"+DateTypeConverter.toDefaultDateTime(latest.getShutdownTime()));
        long totalTime=latest.getShutdownTime().getTime()-first.getStartupTime().getTime();
        LOG.debug("系统总时间:"+latest.getShutdownTime().getTime()+"-"+first.getStartupTime().getTime()+"="+totalTime);
        long runingTime=0;
        for(RuningTime item : models){
            LOG.debug("      增加系统运行时间:"+item.getRuningTime());
            runingTime+=item.getRuningTime();
        }
View Full Code Here

        DictionaryGenerator.generateDic(basePath);
       
        if(runingMonitor){
            LOG.info("记录服务器启动日志");
            LOG.info("Recording the server boot logging", Locale.ENGLISH);
            runingTime=new RuningTime();
            try {
                runingTime.setServerIP(InetAddress.getLocalHost().getHostAddress());
            } catch (UnknownHostException e) {
                LOG.error("记录服务器启动日志出错", e);
                LOG.error("Failed to record the server boot logging", e, Locale.ENGLISH);
View Full Code Here

TOP

Related Classes of org.apdplat.module.monitor.model.RuningTime

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.