|
@@ -128,6 +128,7 @@ func (e *Event) EventLists(c *dto.EventStatisticReq, result *[]dto.EventListsRes
|
|
|
db.Select([]string{
|
|
|
"StatusMessage",
|
|
|
"COUNT(*) AS StatusMessageCount",
|
|
|
+ "ServiceName",
|
|
|
})
|
|
|
if c.AppAlias != "" {
|
|
|
db.Where("AppAlias = ?", c.AppAlias)
|
|
@@ -147,6 +148,7 @@ func (e *Event) EventLists(c *dto.EventStatisticReq, result *[]dto.EventListsRes
|
|
|
db.Where("Timestamp >= ? AND Timestamp <= ?", c.StartTime, c.EndTime)
|
|
|
db.Where("StatusCode = 'STATUS_CODE_ERROR' AND StatusMessage != '' AND StatusMessage != 'status code:0'")
|
|
|
db.Group("StatusMessage")
|
|
|
+ db.Group("ServiceName")
|
|
|
if err := db.Order("StatusMessageCount DESC;").Find(&result).Error; err != nil {
|
|
|
return errors.Wrap(err, "统计范围时间内的具体异常失败")
|
|
|
}
|