package model

import "time"

// DailyStat corresponds to the daily_stats table.“
type DailyStat struct {
	ID                  int64   `gorm:"primaryKey;autoIncrement"`
	OrgID               string  `gorm:"size:512"`
	ClusterID           string  `gorm:"size:512"`
	ReportDate          string  `gorm:"type:date;not null"`
	SqlTimestamp        float64 `gorm:"not null"`
	PatternName         string  `gorm:"size:255"`
	Level               string  `gorm:"size:50"`
	Query               string  `gorm:"type:text"`
	Digest              string  `gorm:"size:512;not null"`
	IsNew               bool
	TotalCount          int `gorm:"not null"`
	AvgQueryTime        float64
	AvgMemMax           float64
	MaxMem              int64
	TotalCpuTime        float64
	TotalCpuTimePer     float64
	MaxCpuTimeIn5Min    float64
	MaxCpuTimeIn5MinPer float64
	CreatedAt           time.Time `gorm:"type:datetime(3)"`
}

func (DailyStat) TableName() string {
	return "daily_stats"
}
