PerformanceServiceProc

本文介绍了一个用于收集和处理服务器性能数据的Java类。该类能够接收来自不同门户服务器的性能数据,将其汇总并存储在数据库中。同时,还提供定期清理过期统计数据的功能。
public class PerformanceServiceProc
{
    /**
     * 调测日志记录器。
     */
    private static Logger logger = Logger.getLogger(PerformanceServiceProc.class);
    
    /**
     *  保存收到的portal服务器的性能数据的列表
     */
    private ArrayList<Performance> performanceList = new ArrayList<Performance>();
    
    
    /**
     * 性能统计的服务器实体对象
     */
    private PortalServerService portalServerService = new PortalServerService();
    
    /**
     *  数据库操作的Dao对象
     */
    private PerformanceService performanceService = new PerformanceServiceImpl(); 


    /**
     * 
     * 周期时间类的数据已经服务器名称记录到列表中。
     * @param performance 性能统计对象
     */
    private void addPerformanceList(Performance performance)
    {
        logger.recordEnterMethodLog();
        
        if (null == performance)
        {
            return;
        }


        boolean isExist = false;
        String portalId = performance.getPortalServerId();
        for (Performance existPerformance : performanceList)
        {
            if (portalId.equals(existPerformance.getPortalServerId()))
            {
                isExist = true;
                existPerformance.add(performance);
            }
        }
        
        if (!isExist)
        {
            performanceList.add(performance);
        }
        
        logger.recordExitMethodLog();
    }
    
    
    /**
     * 
     * 处理业务信息性能统计数据的入口函数
     * 
     * @param object 性能统计对象
     * @return 0成功,非0 失败
     */
    public int procPerformance(Object object)
    {
        logger.recordEnterMethodLog();
        
        if (null == object)
        {
            return PortalCommonConst.RESULT_FAIL;
        }
        
        Performance performance = (Performance)object;  
        
        //取当前数据汇聚时的时间
        Timestamp timestamp = performance.getPerformanceDateTime();
        
        String portalName = performance.getPortalServerId();
        if (portalServerService.isServerRecord(portalName, timestamp))
        {
            return PortalCommonConst.RESULT_SUCCESS;
        }
        else 
        {
            portalServerService.record(portalName, timestamp); 
            addPerformanceList(performance);
        }
        
        logger.recordExitMethodLog();
        return PortalCommonConst.RESULT_SUCCESS;
    }
    
    /**
     * 
     * 服务端周期处理性能统计数据的入口函数。
     *
     */
    public void procPerformanceResult()
    {
        logger.recordEnterMethodLog();


        // 累加各个服务器的统计数据
        Performance performance = new Performance();
        for (Performance performanceFromList : performanceList)
        {
            performance.add(performanceFromList);
        }
        
        //设置统计时间
        Timestamp timestamp = new Timestamp(CommonProcess.getCurTimeByZone());
        performance.setPerformanceDateTime(timestamp);
        
        // 添加本次未统计到的服务器的id
        performance.setUnRecordPortalServerId(portalServerService.getUnrecordServerName());
        
        //将数据入库
        if (performanceService.addData(performance))
        {
            //清理统计列表
            performanceList.clear();
        }
        else 
        {
            // 添加数据失败,更新下次更新时间,下次统计的时候和前一次的一起统计。
            logger.recordErrorsLog("addData error");
            performance.setUnRecordPortalServerId(null);
        }
        
        logger.recordExitMethodLog();
    }
    
    
    /**
     * 定期删除话统信息
     * 
     */
    public void perClearPerformance()
    {
        logger.recordEnterMethodLog();
        
        performanceService.deletePerformanceByTime();
        performanceService.deleteSystemPerformanceByTime();
        
        logger.recordExitMethodLog();
    }
}
农业作物成熟度实例分割数据集 一、基础信息 • 数据集名称:农业作物成熟度实例分割数据集 • 图片数量: 训练集:563张图片 验证集:161张图片 测试集:80张图片 总计:804张图片 • 训练集:563张图片 • 验证集:161张图片 • 测试集:80张图片 • 总计:804张图片 • 分类类别: bfullyripened: b类作物完全成熟状态 bgreen: b类作物绿色未成熟状态 bhalfripened: b类作物半成熟状态 lfullyripened: l类作物完全成熟状态 lgreen: l类作物绿色未成熟状态 lhalfripened: l类作物半成熟状态 • bfullyripened: b类作物完全成熟状态 • bgreen: b类作物绿色未成熟状态 • bhalfripened: b类作物半成熟状态 • lfullyripened: l类作物完全成熟状态 • lgreen: l类作物绿色未成熟状态 • lhalfripened: l类作物半成熟状态 • 标注格式:YOLO格式,包含实例分割多边形点标注,适用于实例分割任务。 • 数据格式:图片来源于农业图像数据库,细节清晰,适用于模型训练。 二、适用场景 • 农业AI监测系统开发:数据集支持实例分割任务,帮助构建能够自动识别作物部分并分类成熟度的AI模型,辅助农民进行精准农业管理。 • 精准农业应用研发:集成至农业智能平台,提供实时作物状态识别功能,优化灌溉、施肥和收获时间。 • 学术研究与创新:支持农业科学与人工智能交叉领域的研究,助力发表高水平农业AI论文。 • 农业教育与培训:数据集可用于农业院校或培训机构,作为学生学习作物识别和成熟度评估的重要资源。 三、数据集优势 • 精准标注与多样性:每张图片均经过精确标注,确保实例分割边界准确,类别分类正确。涵盖两种作物类型(b和l)和三种成熟度状态(完全成熟、绿色未成熟、半成熟),具有高度多样性,提升模型泛化能力。 • 任务适配性强:标注兼容主流深度学习框架(如YOLO等),可直接加载使用,支持实例分割任务,并可扩展到其他计算机视觉任务。 • 农业价值突出:专注于作物成熟度检测,为智能农业、自动化收获和作物健康监测提供关键数据支持,具有重要的实际应用价值。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值