| @@ -668,7 +668,7 @@ func CounDataByDateAndReCount(wikiCountMap map[string]int, startTime time.Time, | |||||
| dateRecord.NpuTrainJob = getMapKeyStringValue(fmt.Sprint(dateRecord.ID)+"_NpuTrainJob", CloudBrainTaskItemMap) | dateRecord.NpuTrainJob = getMapKeyStringValue(fmt.Sprint(dateRecord.ID)+"_NpuTrainJob", CloudBrainTaskItemMap) | ||||
| dateRecord.NpuInferenceJob = getMapKeyStringValue(fmt.Sprint(dateRecord.ID)+"_NpuInferenceJob", CloudBrainTaskItemMap) | dateRecord.NpuInferenceJob = getMapKeyStringValue(fmt.Sprint(dateRecord.ID)+"_NpuInferenceJob", CloudBrainTaskItemMap) | ||||
| dateRecord.GpuBenchMarkJob = getMapKeyStringValue(fmt.Sprint(dateRecord.ID)+"_GpuBenchMarkJob", CloudBrainTaskItemMap) | dateRecord.GpuBenchMarkJob = getMapKeyStringValue(fmt.Sprint(dateRecord.ID)+"_GpuBenchMarkJob", CloudBrainTaskItemMap) | ||||
| dateRecord.CloudBrainRunTime = getMapKeyStringValue(fmt.Sprint(dateRecord.ID)+"_CloudBrainRunTime", CloudBrainTaskItemMap) | |||||
| dateRecord.CommitModelCount = getMapValue(dateRecord.ID, AiModelManageMap) | dateRecord.CommitModelCount = getMapValue(dateRecord.ID, AiModelManageMap) | ||||
| dateRecord.UserIndex = getUserIndex(dateRecord, ParaWeight) | dateRecord.UserIndex = getUserIndex(dateRecord, ParaWeight) | ||||
| setUserMetrics(userMetrics, userRecord, start_unix, end_unix, dateRecord) | setUserMetrics(userMetrics, userRecord, start_unix, end_unix, dateRecord) | ||||
| @@ -1375,7 +1375,7 @@ func queryCloudBrainTask(start_unix int64, end_unix int64) (map[int64]int, map[s | |||||
| } else { | } else { | ||||
| resultMap[cloudTaskRecord.UserID] += 1 | resultMap[cloudTaskRecord.UserID] += 1 | ||||
| } | } | ||||
| setMapKey("time", cloudTaskRecord.UserID, int(cloudTaskRecord.Duration), resultItemMap) | |||||
| setMapKey("CloudBrainRunTime", cloudTaskRecord.UserID, int(cloudTaskRecord.Duration), resultItemMap) | |||||
| if cloudTaskRecord.Type == 1 { //npu | if cloudTaskRecord.Type == 1 { //npu | ||||
| if cloudTaskRecord.JobType == "TRAIN" { | if cloudTaskRecord.JobType == "TRAIN" { | ||||
| setMapKey("NpuTrainJob", cloudTaskRecord.UserID, 1, resultItemMap) | setMapKey("NpuTrainJob", cloudTaskRecord.UserID, 1, resultItemMap) | ||||
| @@ -95,7 +95,7 @@ func queryUserDataPage(ctx *context.Context, tableName string, queryObj interfac | |||||
| xlsx.SetCellValue(sheetName, "P"+rows, formatTime[0:len(formatTime)-3]) | xlsx.SetCellValue(sheetName, "P"+rows, formatTime[0:len(formatTime)-3]) | ||||
| xlsx.SetCellValue(sheetName, "Q"+rows, userRecord.CloudBrainTaskNum) | xlsx.SetCellValue(sheetName, "Q"+rows, userRecord.CloudBrainTaskNum) | ||||
| xlsx.SetCellValue(sheetName, "R"+rows, userRecord.CloudBrainRunTime) | |||||
| xlsx.SetCellValue(sheetName, "R"+rows, fmt.Sprintf("%.2f", float64(userRecord.CloudBrainRunTime)/3600)) | |||||
| xlsx.SetCellValue(sheetName, "S"+rows, userRecord.CommitDatasetNum) | xlsx.SetCellValue(sheetName, "S"+rows, userRecord.CommitDatasetNum) | ||||
| xlsx.SetCellValue(sheetName, "T"+rows, userRecord.CommitModelCount) | xlsx.SetCellValue(sheetName, "T"+rows, userRecord.CommitModelCount) | ||||
| xlsx.SetCellValue(sheetName, "U"+rows, fmt.Sprintf("%.2f", userRecord.UserIndex)) | xlsx.SetCellValue(sheetName, "U"+rows, fmt.Sprintf("%.2f", userRecord.UserIndex)) | ||||
| @@ -232,7 +232,12 @@ func QueryUserStaticDataPage(ctx *context.Context) { | |||||
| "N1": ctx.Tr("user.static.createrepocount"), | "N1": ctx.Tr("user.static.createrepocount"), | ||||
| "O1": ctx.Tr("user.static.openiindex"), | "O1": ctx.Tr("user.static.openiindex"), | ||||
| "P1": ctx.Tr("user.static.registdate"), | "P1": ctx.Tr("user.static.registdate"), | ||||
| "Q1": ctx.Tr("user.static.countdate"), | |||||
| "Q1": ctx.Tr("user.static.CloudBrainTaskNum"), | |||||
| "R1": ctx.Tr("user.static.CloudBrainRunTime"), | |||||
| "S1": ctx.Tr("user.static.CommitDatasetNum"), | |||||
| "T1": ctx.Tr("user.static.CommitModelCount"), | |||||
| "U1": ctx.Tr("user.static.UserIndex"), | |||||
| "V1": ctx.Tr("user.static.countdate"), | |||||
| } | } | ||||
| for k, v := range dataHeader { | for k, v := range dataHeader { | ||||
| //设置单元格的值 | //设置单元格的值 | ||||
| @@ -260,9 +265,13 @@ func QueryUserStaticDataPage(ctx *context.Context) { | |||||
| formatTime := userRecord.RegistDate.Format("2006-01-02 15:04:05") | formatTime := userRecord.RegistDate.Format("2006-01-02 15:04:05") | ||||
| xlsx.SetCellValue(sheetName, "P"+rows, formatTime[0:len(formatTime)-3]) | xlsx.SetCellValue(sheetName, "P"+rows, formatTime[0:len(formatTime)-3]) | ||||
| xlsx.SetCellValue(sheetName, "Q"+rows, userRecord.CloudBrainTaskNum) | |||||
| xlsx.SetCellValue(sheetName, "R"+rows, fmt.Sprintf("%.2f", float64(userRecord.CloudBrainRunTime)/3600)) | |||||
| xlsx.SetCellValue(sheetName, "S"+rows, userRecord.CommitDatasetNum) | |||||
| xlsx.SetCellValue(sheetName, "T"+rows, userRecord.CommitModelCount) | |||||
| xlsx.SetCellValue(sheetName, "U"+rows, fmt.Sprintf("%.2f", userRecord.UserIndex)) | |||||
| formatTime = userRecord.DataDate | formatTime = userRecord.DataDate | ||||
| xlsx.SetCellValue(sheetName, "Q"+rows, formatTime+" 00:01") | |||||
| xlsx.SetCellValue(sheetName, "V"+rows, formatTime) | |||||
| } | } | ||||
| //设置默认打开的表单 | //设置默认打开的表单 | ||||
| @@ -145,6 +145,9 @@ | |||||
| label="云脑运行时间(小时)" | label="云脑运行时间(小时)" | ||||
| width="120px" | width="120px" | ||||
| align="center"> | align="center"> | ||||
| <template slot-scope="scope"> | |||||
| {{scope.row.CloudBrainRunTime | roundingToHour}} | |||||
| </template> | |||||
| </el-table-column> | </el-table-column> | ||||
| <el-table-column | <el-table-column | ||||
| prop="CommitDatasetNum" | prop="CommitDatasetNum" | ||||
| @@ -387,6 +390,9 @@ | |||||
| rounding (value) { | rounding (value) { | ||||
| return Number(value).toFixed(2) | return Number(value).toFixed(2) | ||||
| }, | }, | ||||
| roundingToHour (value) { | |||||
| return (Number(value)/3600).toFixed(2) | |||||
| }, | |||||
| transformTimestamp(timestamp){ | transformTimestamp(timestamp){ | ||||
| let a = new Date(timestamp*1000); | let a = new Date(timestamp*1000); | ||||
| const date = new Date(a); | const date = new Date(a); | ||||