isupervisor

package module
v0.0.0-...-262c439 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2023 License: MIT Imports: 9 Imported by: 0

README

isupervisor

ISUCON supervisor.

Usage

isupervisor

LICENSE

MIT

Author

fujiwara

Documentation

Index

Constants

View Source
const (
	// StatusPending is the status of a job that is waiting to be run.
	StatusPending = 0
	// StatusRunning is the status of a job that is currently running.
	StatusRunning = 1
	// StatusFinished is the status of a job that has finished running.
	StatusFinished = 2
)

Variables

View Source
var ReportTimeout = time.Second * 5

Functions

This section is empty.

Types

type Isupervisor

type Isupervisor struct {
	Recieve func(context.Context) (*Job, error)
	Report  func(context.Context, *Report) error
}

func (*Isupervisor) Run

func (isu *Isupervisor) Run(ctx context.Context) error

type Job

type Job struct {
	ID          string   `json:"id"`
	TeamID      string   `json:"team_id"`
	Command     []string `json:"command"`
	SoftTimeout int64    `json:"soft_timeout"`
	HardTimeout int64    `json:"hard_timeout"`
}

type Report

type Report struct {
	Job      *Job   `json:"job"`
	Status   int    `json:"status"` // 0: pending, 1: running, 2: finished
	Stdout   string `json:"stdout"`
	Stderr   string `json:"stderr"`
	ExitCode int    `json:"exit_code"`
	Result   Result `json:"result"`
}

type Result

type Result struct {
	Finished bool  `json:"finished"`
	Passed   bool  `json:"passed"`
	Score    int64 `json:"score"`
}

Directories

Path Synopsis
cmd
isupervisor command

Jump to

Keyboard shortcuts

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