#2177 1、解决云脑解压时没有设置解压中状态。2、解决当天用户统计使用时间戳为中国时间。3、云脑任务统计没有计算再次调试的任务。

Merged
lewis merged 4 commits from V20220519_patch into V20220601 1 year ago
  1. +2
    -2
      models/user_business_analysis.go
  2. +7
    -6
      routers/repo/attachment.go
  3. +4
    -1
      routers/repo/user_data_analysis.go

+ 2
- 2
models/user_business_analysis.go View File

@@ -1112,7 +1112,7 @@ func setUserMetrics(userMetrics map[string]int, user *User, start_time int64, en
//HasActivityUser int `xorm:"NOT NULL DEFAULT 0"`
//TotalActivateRegistUser int `xorm:"NOT NULL DEFAULT 0"`
//TotalHasActivityUser
regist_time := user.CreatedUnix.AsTime().Unix()
regist_time := int64(user.CreatedUnix)
if regist_time >= start_time && regist_time <= end_time {
if user.IsActive {
userMetrics["ActivateRegistUser"] = getMapKeyStringValue("ActivateRegistUser", userMetrics) + 1
@@ -2049,7 +2049,7 @@ func queryCloudBrainTask(start_unix int64, end_unix int64) (map[int64]int, map[s
var indexTotal int64
indexTotal = 0
for {
sess.Select("id,job_type,user_id,duration,train_job_duration,type").Table("cloudbrain").Where(cond).OrderBy("id asc").Limit(PAGE_SIZE, int(indexTotal))
sess.Select("id,job_type,user_id,duration,train_job_duration,type").Table("cloudbrain").Unscoped().Where(cond).OrderBy("id asc").Limit(PAGE_SIZE, int(indexTotal))
cloudTaskList := make([]*Cloudbrain, 0)
sess.Find(&cloudTaskList)
log.Info("query cloudbrain size=" + fmt.Sprint(len(cloudTaskList)))


+ 7
- 6
routers/repo/attachment.go View File

@@ -902,16 +902,17 @@ func CompleteMultipart(ctx *context.Context) {
if err != nil {
log.Error("SendDecompressTask(%s) failed:%s", uuid, err.Error())
} else {
attachment.DecompressState = models.DecompressStateIng
err = models.UpdateAttachment(attachment)
if err != nil {
log.Error("UpdateAttachment state(%s) failed:%s", uuid, err.Error())
}
updateAttachmentDecompressStateIng(attachment)
}
}
if typeCloudBrain == models.TypeCloudBrainTwo {
attachjson, _ := json.Marshal(attachment)
labelmsg.SendDecompressAttachToLabelOBS(string(attachjson))
err = labelmsg.SendDecompressAttachToLabelOBS(string(attachjson))
if err != nil {
log.Error("SendDecompressTask to labelsystem (%s) failed:%s", attachment.UUID, err.Error())
} else {
updateAttachmentDecompressStateIng(attachment)
}
}
} else {
var labelMap map[string]string


+ 4
- 1
routers/repo/user_data_analysis.go View File

@@ -691,8 +691,11 @@ func TimingCountDataByDateAndReCount(date string, isReCount bool) {

t, _ := time.Parse("2006-01-02", date)
startTime := time.Date(t.Year(), t.Month(), t.Day(), 0, 0, 0, 0, t.Location())
startTime = startTime.UTC()
endTime := time.Date(t.Year(), t.Month(), t.Day(), 23, 59, 59, 0, t.Location())
endTime = endTime.UTC()
log.Info("startTime time:" + startTime.Format("2006-01-02 15:04:05"))
log.Info("endTime time:" + endTime.Format("2006-01-02 15:04:05"))
warnEmailMessage := "用户统计信息入库失败,请尽快定位。"
//query wiki data
log.Info("start to time count data")


Loading…
Cancel
Save