From a9c19115d471b09a7a65d59d40be0ec68292e5c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=97=E5=AD=90?= Date: Sat, 13 Jan 2024 02:19:33 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E7=B3=BB=E7=BB=9F=E7=9B=91=E6=8E=A7):=20?= =?UTF-8?q?=E5=8E=BB=E9=99=A4=E9=83=A8=E5=88=86=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/console/commands/monitoring.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/console/commands/monitoring.go b/app/console/commands/monitoring.go index cb10fcaf..f5c6086a 100644 --- a/app/console/commands/monitoring.go +++ b/app/console/commands/monitoring.go @@ -51,6 +51,17 @@ func (receiver *Monitoring) Handle(ctx console.Context) error { info := tools.GetMonitoringInfo() + // 去除部分数据以减少数据库存储 + info.Disk = nil + for _, cpu := range info.Cpus { + cpu.VendorID = "" + cpu.Family = "" + cpu.Model = "" + cpu.PhysicalID = "" + cpu.ModelName = "" + cpu.Flags = nil + } + err := facades.Orm().Query().Create(&models.Monitor{ Info: info, })