Skip to content
Snippets Groups Projects
Select Git revision
  • 8c45428d2548ef5aca8ebcb10fb280356ec4feeb
  • master default protected
  • 0.8.2
  • 0.8.1
  • 0.8.0
  • 0.7.13
  • 0.7.12
  • 0.7.11
  • 0.7.10
  • 0.7.9
  • 0.7.8
  • 0.7.7
  • 0.7.6
  • 0.7.5
  • 0.7.4
  • 0.7.3
  • 0.7.2
  • 0.7.1
  • 0.7.0
  • 0.6.27
  • 0.6.26
  • 0.6.25
22 results

flake.lock

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"
    }