From 22b8f1c5e24e9bfd54a5572244010130ce60484e Mon Sep 17 00:00:00 2001 From: CODE <1650192445@qq.com> Date: Wed, 13 Sep 2023 16:07:13 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=99=E4=B9=88=E5=BC=82=E5=B8=B8=E7=8E=87?= =?UTF-8?q?=E6=8E=A8=E9=80=81log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/lib/schedule/alarms_push.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/api/app/lib/schedule/alarms_push.js b/api/app/lib/schedule/alarms_push.js index 356d097..668f9df 100644 --- a/api/app/lib/schedule/alarms_push.js +++ b/api/app/lib/schedule/alarms_push.js @@ -288,6 +288,7 @@ module.exports = function (app, opts) { `).toPromise() : [] deviceCount = deviceCountRes.length ? deviceCountRes[0].count : 0 + pLog(`查得安心云当前项目下设备总数量 - ${deviceCount}`) } if (c.alarmType.includes('video_exception')) { // 查了视频异常 去安心云查 接入的 萤石 设备数量 @@ -297,9 +298,10 @@ module.exports = function (app, opts) { WHERE structure IN (${searchStrucIds.join(',')}) `).toPromise())[0].count : 0 + pLog(`查得安心云当前项目下萤石设备总数量 - ${cameraCount}`) } emailTitle += `异常率推送服务` - emailSubTitle += `持续产生时间超过${interval}分钟的异常设备数量${interval}个,异常率达到项目或结构物内设备总数量${parseInt(deviceCount) + parseInt(cameraCount)}个的 --%,详情如下` + emailSubTitle += `持续产生时间超过${interval}分钟的异常设备数量${interval}个,异常率达到项目或结构物内设备总数量${parseInt(deviceCount) + parseInt(cameraCount)}个的 --%,详情如下` // --% 是在下面计算得 } } emailTitle += '_POMS飞尚运维中台' @@ -1083,8 +1085,10 @@ module.exports = function (app, opts) { deviceStatistic.add(d.SourceId) } if (c.tactics == 'abnormal_rate') { + pLog(`异常设备数量 - ${deviceStatistic.size}`) + pLog(`异常视频告警数量 - ${videoAlarms.length}`) let rate = ((deviceStatistic.size + videoAlarms.length) / (parseInt(deviceCount) + parseInt(cameraCount))); - + pLog(`异常比率 ${rate} 设定值 ${deviceProportion}`) if (rate < parseFloat(deviceProportion)) { // 设备异常率低于设定值 continue