recorder

package
v1.0.1-0...-3235677 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2014 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JobEntry

type JobEntry struct {
	Status    string           `bson:"status,omitempty"`
	ExitCode  *int             `bson:"exitCode,omitempty"`
	Error     string           `bson:"error,omitempty"`
	Stdout    []byte           `bson:"stdout,omitempty"`
	Timestamp ftime.UnixMillis `bson:"timestamp"`
}

type JobRecord

type JobRecord struct {
	Owner   string      `bson:"owner,omitempty"`
	JobId   uint64      `bson:"jobId"`
	Cmd     string      `bson:"cmd"`
	Entries []JobEntry  `bson:"entries"`
	Data    interface{} `bson:"data"`
}

type JobRecorder

type JobRecorder struct {
	// contains filtered or unexported fields
}

func New

func New(url string) (recorder *JobRecorder, err error)

func (*JobRecorder) RecordJob

func (r *JobRecorder) RecordJob(owner string, id uint64, cmd string, data interface{}) (err error)

func (*JobRecorder) UpdateJob

func (r *JobRecorder) UpdateJob(result JobResult) (err error)

type JobResult

type JobResult struct {

	// Buried is true if the job was buried.
	Buried bool

	// Executed is true if the job command was executed (or attempted).
	Executed bool

	// ExitStatus of the command; 0 for success.
	ExitStatus int

	// JobId from beanstalkd.
	JobId uint64

	// Stdout of the command.
	Stdout []byte

	// TimedOut indicates the worker exceeded TTR for the job.
	// Note this is tracked by a timer, separately to beanstalkd.
	TimedOut bool

	// Error raised while attempting to handle the job.
	Error error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL