|
|
@@ -846,13 +846,17 @@ func RefreshUserYearTable(pageStartTime time.Time, pageEndTime time.Time) { |
|
|
|
scoreMap["codescore"] = codescore |
|
|
|
cloudBrainInfo := getCloudBrainInfo(&dateRecordAll, CloudBrainTaskItemMap, scoreMap) |
|
|
|
playARoll := getPlayARoll(bonusMap, dateRecordAll.Name, scoreMap) |
|
|
|
exteral := 0 |
|
|
|
if int(subTime.Hours())%24 > 0 { |
|
|
|
exteral = 1 |
|
|
|
} |
|
|
|
re := &UserSummaryCurrentYear{ |
|
|
|
ID: dateRecordAll.ID, |
|
|
|
Name: dateRecordAll.Name, |
|
|
|
Email: dateRecordAll.Email, |
|
|
|
Phone: dateRecordAll.Phone, |
|
|
|
RegistDate: dateRecordAll.RegistDate, |
|
|
|
DateCount: int(subTime.Hours()) / 24, |
|
|
|
DateCount: int(subTime.Hours())/24 + exteral, |
|
|
|
MostActiveDay: mostActiveDay, |
|
|
|
RepoInfo: repoInfo, |
|
|
|
DataSetInfo: dataSetInfo, |
|
|
@@ -870,17 +874,6 @@ func RefreshUserYearTable(pageStartTime time.Time, pageEndTime time.Time) { |
|
|
|
log.Info("update user year data finished. ") |
|
|
|
} |
|
|
|
|
|
|
|
func isUserYearData(tableName string) bool { |
|
|
|
if tableName == "user_business_analysis_current_year" { |
|
|
|
currentTimeNow := time.Now() |
|
|
|
if currentTimeNow.Year() >= 2023 { |
|
|
|
return false |
|
|
|
} |
|
|
|
return true |
|
|
|
} |
|
|
|
return false |
|
|
|
} |
|
|
|
|
|
|
|
func getBonusWeekDataMap() map[int64][]int { |
|
|
|
bonusMap := make(map[int64][]int) |
|
|
|
url := setting.RecommentRepoAddr + "bonus/weekdata/record.txt" |
|
|
@@ -2307,7 +2300,7 @@ func queryUserCreateRepo(start_unix int64, end_unix int64) (map[int64]int, map[s |
|
|
|
var indexTotal int64 |
|
|
|
indexTotal = 0 |
|
|
|
for { |
|
|
|
sess.Select("id,owner_id,name,is_private,clone_cnt").Table("repository").Where(cond).OrderBy("id asc").Limit(PAGE_SIZE, int(indexTotal)) |
|
|
|
sess.Select("id,owner_id,name,is_private,clone_cnt,alias").Table("repository").Where(cond).OrderBy("id asc").Limit(PAGE_SIZE, int(indexTotal)) |
|
|
|
repoList := make([]*Repository, 0) |
|
|
|
sess.Find(&repoList) |
|
|
|
log.Info("query Repository size=" + fmt.Sprint(len(repoList))) |
|
|
@@ -2530,6 +2523,13 @@ func queryUserModelConvert(start_unix int64, end_unix int64) map[int64]int { |
|
|
|
return resultMap |
|
|
|
} |
|
|
|
|
|
|
|
func isBenchMark(JobType string) bool { |
|
|
|
if JobType == "BENCHMARK" || JobType == "MODELSAFETY" || JobType == "SNN4IMAGENET" || JobType == "BRAINSCORE" || JobType == "SNN4ECOSET" { |
|
|
|
return true |
|
|
|
} |
|
|
|
return false |
|
|
|
} |
|
|
|
|
|
|
|
func queryCloudBrainTask(start_unix int64, end_unix int64) (map[int64]int, map[string]int) { |
|
|
|
sess := x.NewSession() |
|
|
|
defer sess.Close() |
|
|
@@ -2565,7 +2565,7 @@ func queryCloudBrainTask(start_unix int64, end_unix int64) (map[int64]int, map[s |
|
|
|
setMapKey("NpuTrainJob", cloudTaskRecord.UserID, 1, resultItemMap) |
|
|
|
} else if cloudTaskRecord.JobType == "INFERENCE" { |
|
|
|
setMapKey("NpuInferenceJob", cloudTaskRecord.UserID, 1, resultItemMap) |
|
|
|
} else if cloudTaskRecord.JobType == "BENCHMARK" || cloudTaskRecord.JobType == "MODELSAFETY" { |
|
|
|
} else if isBenchMark(cloudTaskRecord.JobType) { |
|
|
|
setMapKey("GpuBenchMarkJob", cloudTaskRecord.UserID, 1, resultItemMap) |
|
|
|
} else { |
|
|
|
setMapKey("NpuDebugJob", cloudTaskRecord.UserID, 1, resultItemMap) |
|
|
@@ -2576,7 +2576,7 @@ func queryCloudBrainTask(start_unix int64, end_unix int64) (map[int64]int, map[s |
|
|
|
setMapKey("GpuTrainJob", cloudTaskRecord.UserID, 1, resultItemMap) |
|
|
|
} else if cloudTaskRecord.JobType == "INFERENCE" { |
|
|
|
setMapKey("GpuInferenceJob", cloudTaskRecord.UserID, 1, resultItemMap) |
|
|
|
} else if cloudTaskRecord.JobType == "BENCHMARK" || cloudTaskRecord.JobType == "MODELSAFETY" { |
|
|
|
} else if isBenchMark(cloudTaskRecord.JobType) { |
|
|
|
setMapKey("GpuBenchMarkJob", cloudTaskRecord.UserID, 1, resultItemMap) |
|
|
|
} else { |
|
|
|
setMapKey("GpuDebugJob", cloudTaskRecord.UserID, 1, resultItemMap) |
|
|
|