|
|
|
@@ -3,8 +3,25 @@ package models |
|
|
|
import ( |
|
|
|
"strconv" |
|
|
|
"time" |
|
|
|
|
|
|
|
"code.gitea.io/gitea/modules/timeutil" |
|
|
|
) |
|
|
|
|
|
|
|
// Cloudbrain statistic info of all CloudbrainTasks |
|
|
|
type CloudbrainStatistic struct { |
|
|
|
ID int64 `xorm:"pk autoincr" json:"-"` |
|
|
|
Date string `xorm:"unique(s) NOT NULL" json:"date"` |
|
|
|
NumDubugOne int64 `xorm:"NOT NULL DEFAULT 0" json:"numDubugOne"` |
|
|
|
NumBenchmarkOne int64 `xorm:"NOT NULL DEFAULT 0" json:"numBenchmarkOne"` |
|
|
|
NumTrainOne int64 `xorm:"NOT NULL DEFAULT 0" json:"numTrainOne"` |
|
|
|
NumDubugTwo int64 `xorm:"NOT NULL DEFAULT 0" json:"numDubugTwo"` |
|
|
|
NumTrainTwo int64 `xorm:"NOT NULL DEFAULT 0" json:"numTrainTwo"` |
|
|
|
NumInferenceTwo int64 `xorm:"NOT NULL DEFAULT 0" json:"numInferenceTwo"` |
|
|
|
|
|
|
|
CreatedUnix timeutil.TimeStamp `xorm:"INDEX created" json:"-"` |
|
|
|
UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated" json:"-"` |
|
|
|
} |
|
|
|
|
|
|
|
func GenerateDebugOneCount(beginTime time.Time, endTime time.Time) (int64, error) { |
|
|
|
countSql := "SELECT count(*) FROM " + |
|
|
|
"public.cloudbrain where created_unix >=" + strconv.FormatInt(beginTime.Unix(), 10) + |
|
|
|
|