Skip to content
Snippets Groups Projects
Select Git revision
  • 97c970370d43d875c3c4615888735298129172a8
  • master default protected
  • v1.23.2
  • v1.23.1
  • v1.23.0
  • v1.22.0
  • v1.21.1
  • v1.21.0
  • v1.20.3
  • v1.20.2
  • v1.20.1
  • v1.20.0
  • v1.19.4
  • v1.19.3
  • v1.19.2
  • v1.19.1
  • v1.19.0
  • v1.18.2
  • v1.18.1
  • v1.18.0
  • v1.17.0
  • v1.16.1
22 results

job-log.go

Blame
  • job-stat.go 1020 B
    package jobqueue
    
    import (
    	"gorm.io/gorm"
    	"time"
    )
    
    // important: if you want to add fields to this struct, you have to add them to the ResetStats() method as well
    type JobStats struct {
    	JobID        JobID       `json:"job_id" gorm:"primaryKey"`
    	RunCount     int         `json:"run_count"`
    	SuccessCount int         `json:"success_count"`
    	ErrorCount   int         `json:"error_count"`
    	TimeMetrics  TimeMetrics `json:"time_metrics" gorm:"embedded;embeddedPrefix:time_metrics_"`
    
    	CreatedAt time.Time      `gorm:"column:created_at" json:"created_at" yaml:"created_at"`
    	UpdatedAt time.Time      `gorm:"column:updated_at" json:"updated_at" yaml:"updated_at"`
    	DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;index" json:"-" yaml:"-"`
    }
    
    type TimeMetrics struct {
    	AvgRunTime   time.Duration `json:"avg"`
    	MaxRunTime   time.Duration `json:"max"`
    	MinRunTime   time.Duration `json:"min"`
    	TotalRunTime time.Duration `json:"total"`
    }
    
    func (JobStats) TableName() string {
    	return globalTableNamePrefix + "job_stats"
    }