|
@@ -114,12 +114,17 @@ func (e *Event) EventStatistic(c *dto.EventStatisticReq, result *[]dto.EventStat
|
|
|
Group("start_time").Order("start_time").Having("total>0").Find(result).Error
|
|
|
case "interface":
|
|
|
// 改为接口相关的错误分布,与请求总数*错误率对上
|
|
|
- start := time.Unix(c.StartTime, 0).Truncate(time.Hour).Format(time.DateTime)
|
|
|
- end := time.Unix(c.EndTime, 0).Truncate(time.Hour).Add(time.Hour).Format(time.DateTime)
|
|
|
+ // start := time.Unix(c.StartTime, 0).Truncate(time.Hour).Format(time.DateTime)
|
|
|
+ // end := time.Unix(c.EndTime, 0).Truncate(time.Hour).Add(time.Hour).Format(time.DateTime)
|
|
|
+ um := models.UrlMapping{}
|
|
|
+ err := e.Orm.Model(&models.UrlMapping{}).Where("id=?", c.SubconditionValue).First(&um).Error
|
|
|
+ if err != nil {
|
|
|
+ return err
|
|
|
+ }
|
|
|
return e.ChOrm.Debug().Model(&models.TracesURL{}).
|
|
|
Select("toStartOfFiveMinutes(Timestamp) as StartTime, count() as Total").
|
|
|
- Where("Route=? or Path=?", c.SubconditionValue, c.SubconditionValue).
|
|
|
- Where("StartTime>=? and StartTime<?", start, end).
|
|
|
+ Where("Route=? and Method=? and ServiceName=? and AppAlias=?", um.Url, um.Method, um.ServiceName, um.AppAlias).
|
|
|
+ Where("Timestamp>=? and Timestamp<?", c.StartTime, c.EndTime).
|
|
|
Where("StatusCode>=400").
|
|
|
Group("StartTime").Order("StartTime").Find(result).Error
|
|
|
|