Skip to content
Snippets Groups Projects
Select Git revision
  • 7f7e2394c72a1058ee1e986b8c4df8012a190880
  • master default protected
  • 0.5.9
  • 0.5.8
  • 0.5.7
  • 0.5.6
  • 0.5.5
  • 0.5.4
  • 0.5.3
  • 0.5.2
  • 0.5.1
  • 0.5.0
  • 0.4.17
  • 0.4.16
  • 0.4.15
  • 0.4.14
  • 0.4.13
  • 0.4.12
  • 0.4.11
  • 0.4.10
  • 0.4.9
  • 0.4.8
22 results

borders.go

Blame
  • job-log.go 1.37 KiB
    // Copyright 2023 schukai GmbH
    // SPDX-License-Identifier: AGPL-3.0
    
    package jobqueue
    
    import (
    	"gorm.io/gorm"
    	"time"
    )
    
    type JobLog struct {
    	LogID         uint          `gorm:"primarykey;autoIncrement:true" json:"logId"`
    	JobID         JobID         `json:"jobId" gorm:"type:varchar(255);foreignKey:JobID;references:ID"`
    	ProcessID     int           `json:"processId"`
    	StartTime     time.Time     `json:"startTime"`
    	EndTime       time.Time     `json:"endTime"`
    	ExitCode      int           `json:"exitCode"`
    	Result        string        `json:"output" gorm:"type:TEXT"` // Assuming serialized JSON for any type
    	ResourceUsage ResourceUsage `json:"resourceUsage" gorm:"embedded;embeddedPrefix:resource_usage_"`
    	IO            IO            `json:"io" gorm:"embedded;embeddedPrefix:io_"`
    	ErrorMsg      string        `json:"errorMsg"`
    	IsSuccessful  bool          `json:"isSuccessful"`
    
    	CreatedAt time.Time      `gorm:"column:created_at" json:"createdAt" yaml:"createdAt"`
    	UpdatedAt time.Time      `gorm:"column:updated_at" json:"updatedAt" yaml:"updatedAt"`
    	DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;index" json:"-" yaml:"-"`
    }
    
    type ResourceUsage struct {
    	Memory uint64  `json:"memory"`
    	CPU    float64 `json:"cpu"`
    }
    
    type IO struct {
    	Disk    int64 `json:"disk"`
    	Network int64 `json:"network"`
    }
    
    func (JobLog) TableName() string {
    	return globalTableNamePrefix + "job_logs"
    }