package pages

import "github.com/go-arrower/arrower/contexts/admin/internal/views/pages"

Index

Functions

func NewFinishedJobs

func NewFinishedJobs(jobs []jobs.Job, queues jobs.QueueNames) echo.Map

func PresentJobsExamplePayloads

func PresentJobsExamplePayloads(queue, jobType string, payloads [][]byte) echo.Map

func TimeAgo

func TimeAgo(t time.Time) string

Types

type HistoricJob

type HistoricJob struct {
	models.ArrowerGueJobsHistory
	PrettyPayload string
	CreatedAt     string
	EnqueuedAgo   string
	FinishedAgo   string
}

func ConvertFinishedJobsForShow

func ConvertFinishedJobsForShow(jobs []models.ArrowerGueJobsHistory) []HistoricJob

type Job

type Job struct {
	Jobs // either way works

	ShowActions bool
}

func NewJob

func NewJob(jobs []models.ArrowerGueJobsHistory) Job

func (Job) TimelineTime

func (j Job) TimelineTime(t pgtype.Timestamptz) string

TimelineTime could reuse a shared timeFMT function, so it is coherent across pages.

type JobWorker

type JobWorker struct {
	ID                      string
	Queue                   string
	NotSeenSince            string
	Version                 string
	JobTypes                []string
	Workers                 int
	LastSeenAtColourSuccess bool
}

func PresentWorkers

func PresentWorkers(pool []jobs.WorkerPool) []JobWorker

type Jobs

type ListQueuesPage

type ListQueuesPage struct {
	Queues map[jobs.QueueName]jobs.QueueStats
}

type QueuePage

type QueuePage struct {
	Jobs      []viewJob
	QueueName string
	Stats     QueueStats
}

func BuildQueuePage

func BuildQueuePage(queue string, jobs []jobs.Job, kpis jobs.QueueKPIs) QueuePage

type QueueStats

type QueueStats struct {
	PendingJobsPerType   map[string]int
	QueueName            string
	PendingJobs          int
	FailedJobs           int
	ProcessedJobs        int
	AvailableWorkers     int
	PendingJobsErrorRate float64 // can be calculated: FailedJobs * 100 / PendingJobs
	AverageTimePerJob    time.Duration
	EstimateUntilEmpty   time.Duration // can be calculated
}

Source Files

formatters.go job.go jobs.finished.go jobs.job.go jobs.queue.go jobs.schedule.go jobs.workers.go

Version
v0.0.0-20250311203644-ab26c1152cb4 (latest)
Published
Mar 11, 2025
Platform
linux/amd64
Imports
11 packages
Last checked
9 minutes ago

Tools for package owners.