| @@ -97,71 +97,10 @@ func GetAllCloudbrainsOverview(ctx *context.Context) { | |||||
| log.Error("Can not query creatorCount.", err) | log.Error("Can not query creatorCount.", err) | ||||
| return | return | ||||
| } | } | ||||
| // todayStatusResult := make(map[string]int) | |||||
| // cloudBrainNum := make(map[int]int) | |||||
| // cloudBrainOneDuration := int64(0) | |||||
| // cloudBrainTwoDuration := int64(0) | |||||
| // intelligentNetDuration := int64(0) | |||||
| // todayNewJobCount := 0 | |||||
| // if int64(cloudbrain.Cloudbrain.CreatedUnix) >= beginTime.Unix() && int64(cloudbrain.Cloudbrain.CreatedUnix) < endTime.Unix() { | |||||
| // todayNewJobCount += 1 | |||||
| // if _, ok := todayStatusResult[cloudbrain.Status]; !ok { | |||||
| // todayStatusResult[cloudbrain.Status] = 1 | |||||
| // } else { | |||||
| // todayStatusResult[cloudbrain.Status] += 1 | |||||
| // } | |||||
| // } | |||||
| // if _, ok := cloudBrainNum[cloudbrain.Cloudbrain.Type]; !ok { | |||||
| // cloudBrainNum[cloudbrain.Cloudbrain.Type] = 1 | |||||
| // } else { | |||||
| // cloudBrainNum[cloudbrain.Cloudbrain.Type] += 1 | |||||
| // } | |||||
| // if cloudbrain.Cloudbrain.Type == models.TypeCloudBrainOne { | |||||
| // cloudBrainOneDuration = cloudBrainOneDuration + cloudbrain.Cloudbrain.Duration | |||||
| // } | |||||
| // if cloudbrain.Cloudbrain.Type == models.TypeCloudBrainTwo { | |||||
| // cloudBrainTwoDuration = cloudBrainTwoDuration + cloudbrain.Cloudbrain.Duration | |||||
| // } | |||||
| // if cloudbrain.Cloudbrain.Type == models.TypeC2Net { | |||||
| // intelligentNetDuration = intelligentNetDuration + cloudbrain.Cloudbrain.Duration | |||||
| // } | |||||
| // } | |||||
| // count = len(cloudbrains) | |||||
| // page += 1 | |||||
| // } | |||||
| // statusNameList := []string{string(models.ModelArtsTrainJobCompleted), string(models.JobFailed), string(models.ModelArtsTrainJobInit), | |||||
| // string(models.JobRunning), string(models.ModelArtsStartFailed), string(models.JobStopped), string(models.JobSucceeded), | |||||
| // string(models.JobWaiting), string(models.ModelArtsTrainJobKilled)} | |||||
| // for _, v := range statusNameList { | |||||
| // if _, ok := todayStatusResult[v]; !ok { | |||||
| // todayStatusResult[v] = 0 | |||||
| // } | |||||
| // } | |||||
| // cloudBrainTypeList := []int{0, 1, 2} | |||||
| // for _, v := range cloudBrainTypeList { | |||||
| // if _, ok := cloudBrainNum[v]; !ok { | |||||
| // cloudBrainNum[v] = 0 | |||||
| // } | |||||
| // } | |||||
| // todayRunningCount := todayStatusResult[string(models.JobRunning)] | |||||
| // todayCompletedCount := todayStatusResult[string(models.ModelArtsTrainJobCompleted)] + todayStatusResult[string(models.JobFailed)] + | |||||
| // todayStatusResult[string(models.ModelArtsStartFailed)] + todayStatusResult[string(models.JobStopped)] + todayStatusResult[string(models.JobSucceeded)] + todayStatusResult[string(models.ModelArtsTrainJobKilled)] | |||||
| // todayWaitingCount := todayStatusResult[string(models.ModelArtsTrainJobInit)] + todayStatusResult[string(models.JobWaiting)] | |||||
| ctx.JSON(http.StatusOK, map[string]interface{}{ | ctx.JSON(http.StatusOK, map[string]interface{}{ | ||||
| "recordBeginTime": recordBeginTime, | |||||
| "updateTime": now.Unix(), | |||||
| // "cloudBrainNum": cloudBrainNum, | |||||
| // "cloudBrainOneDuration": cloudBrainOneDuration, | |||||
| // "cloudBrainTwoDuration": cloudBrainTwoDuration, | |||||
| // "intelligentNetDuration": intelligentNetDuration, | |||||
| "recordBeginTime": recordBeginTime, | |||||
| "updateTime": now.Unix(), | |||||
| "todayCreatorCount": todayCreatorCount, | "todayCreatorCount": todayCreatorCount, | ||||
| "creatorCount": creatorCount, | "creatorCount": creatorCount, | ||||
| "todayRunningCount": todayRunningCount, | "todayRunningCount": todayRunningCount, | ||||
| @@ -186,7 +125,6 @@ func GetOverviewDuration(ctx *context.Context) { | |||||
| count := pagesize | count := pagesize | ||||
| worker_server_num := 1 | worker_server_num := 1 | ||||
| cardNum := 1 | cardNum := 1 | ||||
| // durationSum := int64(0) | |||||
| durationAllSum := int64(0) | durationAllSum := int64(0) | ||||
| cardDuSum := int64(0) | cardDuSum := int64(0) | ||||