mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-12-30 01:46:37 +08:00
增加查找区域监控对象相关结果API
This commit is contained in:
@@ -99,7 +99,6 @@ func (this *ReportResultDAO) ListResults(tx *dbs.Tx, reportNodeId int64, okState
|
||||
query.Attr("level", level)
|
||||
}
|
||||
_, err = query.
|
||||
Attr("reportNodeId", reportNodeId).
|
||||
Gt("updatedAt", time.Now().Unix()-600).
|
||||
Offset(offset).
|
||||
Limit(size).
|
||||
@@ -109,6 +108,19 @@ func (this *ReportResultDAO) ListResults(tx *dbs.Tx, reportNodeId int64, okState
|
||||
return
|
||||
}
|
||||
|
||||
// FindAllResults 列出所有结果
|
||||
func (this *ReportResultDAO) FindAllResults(tx *dbs.Tx, taskType string, targetId int64) (result []*ReportResult, err error) {
|
||||
_, err = this.Query(tx).
|
||||
Attr("type", taskType).
|
||||
Attr("targetId", targetId).
|
||||
Gt("updatedAt", time.Now().Unix()-600).
|
||||
Desc("isOk").
|
||||
Asc("costMs").
|
||||
Slice(&result).
|
||||
FindAll()
|
||||
return
|
||||
}
|
||||
|
||||
// FindAvgCostMsWithTarget 获取某个对象的平均耗时
|
||||
func (this *ReportResultDAO) FindAvgCostMsWithTarget(tx *dbs.Tx, taskType reporterconfigs.TaskType, targetId int64) (float64, error) {
|
||||
return this.Query(tx).
|
||||
|
||||
Reference in New Issue
Block a user