|
|
|
@@ -719,12 +719,11 @@ func refreshUserStaticTable(wikiCountMap map[string]int, tableName string, pageS |
|
|
|
userIndexMap := make(map[int64]float64, 0) |
|
|
|
maxUserIndex := 0.0 |
|
|
|
minUserIndex := 100000000.0 |
|
|
|
dateRecordBatch := make([]UserBusinessAnalysisAll, 0) |
|
|
|
for { |
|
|
|
sess.Select("`user`.*").Table("user").Where(cond).OrderBy("id asc").Limit(PAGE_SIZE, int(indexTotal)) |
|
|
|
userList := make([]*User, 0) |
|
|
|
sess.Find(&userList) |
|
|
|
|
|
|
|
dateRecordBatch := make([]UserBusinessAnalysisAll, 0) |
|
|
|
for _, userRecord := range userList { |
|
|
|
var dateRecordAll UserBusinessAnalysisAll |
|
|
|
dateRecordAll.ID = userRecord.ID |
|
|
|
@@ -804,18 +803,19 @@ func refreshUserStaticTable(wikiCountMap map[string]int, tableName string, pageS |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if len(dateRecordBatch) > 0 { |
|
|
|
insertTable(dateRecordBatch, tableName, statictisSess) |
|
|
|
insertCount += len(dateRecordBatch) |
|
|
|
if err != nil { |
|
|
|
log.Info("insert all data failed." + err.Error()) |
|
|
|
} |
|
|
|
} |
|
|
|
indexTotal += PAGE_SIZE |
|
|
|
if indexTotal >= count { |
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
|
if len(dateRecordBatch) > 0 { |
|
|
|
insertTable(dateRecordBatch, tableName, statictisSess) |
|
|
|
insertCount += len(dateRecordBatch) |
|
|
|
if err != nil { |
|
|
|
log.Info("insert all data failed." + err.Error()) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if tableName == "user_business_analysis_all" { |
|
|
|
log.Info("TotalHasActivityUser=" + fmt.Sprint(userMetrics["TotalHasActivityUser"])) |
|
|
|
} |
|
|
|
@@ -2057,7 +2057,10 @@ func queryCloudBrainTask(start_unix int64, end_unix int64) (map[int64]int, map[s |
|
|
|
} else { |
|
|
|
resultMap[cloudTaskRecord.UserID] += 1 |
|
|
|
} |
|
|
|
setMapKey("CloudBrainRunTime", cloudTaskRecord.UserID, int(cloudTaskRecord.Duration), resultItemMap) |
|
|
|
if cloudTaskRecord.Duration < 100000000 && cloudTaskRecord.Duration > 0 { |
|
|
|
setMapKey("CloudBrainRunTime", cloudTaskRecord.UserID, int(cloudTaskRecord.Duration), resultItemMap) |
|
|
|
} |
|
|
|
|
|
|
|
if cloudTaskRecord.Type == 1 { //npu |
|
|
|
if cloudTaskRecord.JobType == "TRAIN" { |
|
|
|
setMapKey("NpuTrainJob", cloudTaskRecord.UserID, 1, resultItemMap) |
|
|
|
|