|
@@ -7,15 +7,17 @@ import (
|
|
"cicv-data-closedloop/common/util"
|
|
"cicv-data-closedloop/common/util"
|
|
"github.com/gin-gonic/gin"
|
|
"github.com/gin-gonic/gin"
|
|
"net/http"
|
|
"net/http"
|
|
|
|
+ "time"
|
|
)
|
|
)
|
|
|
|
|
|
type DeviceMonitor struct {
|
|
type DeviceMonitor struct {
|
|
- Id int `db:"id" json:"id"` // 自增id
|
|
|
|
- TotalCpuUsage string `db:"total_cpu_usage" json:"totalCpuUsage"` // cpu总占用
|
|
|
|
- TotalMemoryUsage string `db:"total_memory_usage" json:"totalMemoryUsage"` // 内存总占用
|
|
|
|
- Top10Process string `db:"top10_process" json:"top10Process"` // cpu占用前十的进程信息
|
|
|
|
- DeviceNumber string `db:"device_number" json:"deviceNumber"` // cpu占用前十的进程信息
|
|
|
|
- SocIp string `db:"soc_ip" json:"socIp"` // cpu占用前十的进程信息
|
|
|
|
|
|
+ Id int `db:"id" json:"id"` // 自增id
|
|
|
|
+ TotalCpuUsage string `db:"total_cpu_usage" json:"totalCpuUsage"` // cpu总占用
|
|
|
|
+ TotalMemoryUsage string `db:"total_memory_usage" json:"totalMemoryUsage"` // 内存总占用
|
|
|
|
+ Top10Process string `db:"top10_process" json:"top10Process"` // cpu占用前十的进程信息
|
|
|
|
+ DeviceNumber string `db:"device_number" json:"deviceNumber"` // 设备编号
|
|
|
|
+ SocIp string `db:"soc_ip" json:"socIp"` // 芯片IP
|
|
|
|
+ ReportTime time.Time `db:"report_time" json:"reportTime"` // 数据上报时间
|
|
}
|
|
}
|
|
|
|
|
|
// 保存实车上传的监控信息
|
|
// 保存实车上传的监控信息
|
|
@@ -38,6 +40,7 @@ func SaveDeviceMonitor(c *gin.Context) {
|
|
param.Top10Process,
|
|
param.Top10Process,
|
|
param.DeviceNumber,
|
|
param.DeviceNumber,
|
|
param.SocIp,
|
|
param.SocIp,
|
|
|
|
+ time.Now(),
|
|
}); err != nil {
|
|
}); err != nil {
|
|
c_log.GlobalLogger.Error("插入数据报错:", err)
|
|
c_log.GlobalLogger.Error("插入数据报错:", err)
|
|
c.JSON(http.StatusBadRequest, commonEntity.Response{
|
|
c.JSON(http.StatusBadRequest, commonEntity.Response{
|