Compare commits

...

2 Commits

Author SHA1 Message Date
刘祥超
684ba7082b 修复统计指标数据上传不完整的问题 2021-08-03 14:02:15 +08:00
刘祥超
8934962de2 调整版本号 2021-08-03 10:40:46 +08:00
3 changed files with 9 additions and 6 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
*_plus.go
*-plus.sh

View File

@@ -1,7 +1,7 @@
package teaconst
const (
Version = "0.2.6"
Version = "0.2.7"
ProductName = "Edge Node"
ProcessName = "edge-node"

View File

@@ -131,7 +131,7 @@ ON "` + this.statTableName + `" (
}
// select topN stmt
this.selectTopStmt, err = db.Prepare(`SELECT "id", "hash", "keys", "value", "isUploaded" FROM "` + this.statTableName + `" WHERE "serverId"=? AND "version"=? AND time=? ORDER BY "value" DESC LIMIT 100`)
this.selectTopStmt, err = db.Prepare(`SELECT "id", "hash", "keys", "value", "isUploaded" FROM "` + this.statTableName + `" WHERE "serverId"=? AND "version"=? AND time=? ORDER BY "value" DESC LIMIT 20`)
if err != nil {
return err
}
@@ -354,8 +354,7 @@ func (this *Task) Upload(pauseDuration time.Duration) error {
var pbStats []*pb.UploadingMetricStat
for rows.Next() {
var pbStat = &pb.UploadingMetricStat{
}
var pbStat = &pb.UploadingMetricStat{}
// "id", "hash", "keys", "value", "isUploaded"
var isUploaded int
var keysData []byte
@@ -363,9 +362,11 @@ func (this *Task) Upload(pauseDuration time.Duration) error {
if err != nil {
return nil, err
}
if isUploaded == 1 {
// TODO 先不判断是否已经上传需要改造API进行配合
/**if isUploaded == 1 {
continue
}
}**/
if len(keysData) > 0 {
err = json.Unmarshal(keysData, &pbStat.Keys)
if err != nil {