backend

package
v0.0.0-...-43a2903 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2018 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TimeFormat       string = "2006-01-02 15:04:05"
	BenchmarkJobUUID string = "benchmark_job_uuid"
)
View Source
const (
	Pending   = "pending"
	Deploying = "deploying"
	Running   = "running"
	Finished  = "finished"
	Aborted   = "aborted"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BenchmarkJob

type BenchmarkJob struct {
	ID         int64            `json:"id"`
	CreateTime string           `json:"created_time"`
	Status     string           `json:"status"`
	Meta       *BenchmarkMeta   `json:"meta"`
	Result     *BenchmarkResult `json:"result"`
	// contains filtered or unexported fields
}

func NewBenchmarkJob

func NewBenchmarkJob() *BenchmarkJob

func (*BenchmarkJob) Abort

func (job *BenchmarkJob) Abort(note string) error

func (*BenchmarkJob) GetStatus

func (job *BenchmarkJob) GetStatus() string

func (*BenchmarkJob) Run

func (job *BenchmarkJob) Run(suites []BenchSuite, clusters *ClusterManager) error

type BenchmarkMeta

type BenchmarkMeta struct {
	Creator      string        `json:"user"`
	Note         string        `json:"note"`
	Upstream     string        `json:"from"`
	HttpCallback string        `json:"callback"`
	Packages     []*BinPackage `json:"packages"`
	Pd           *BinPackage   `json:"-"`
	TiKV         *BinPackage   `json:"-"`
	TiDB         *BinPackage   `json:"-"`
}

func NewBenchmarkMeta

func NewBenchmarkMeta() *BenchmarkMeta

func NewBenchmarkMetaFromJSON

func NewBenchmarkMetaFromJSON(data []byte) (*BenchmarkMeta, error)

func (*BenchmarkMeta) Valid

func (meta *BenchmarkMeta) Valid() bool

type BenchmarkResult

type BenchmarkResult struct {
	Cases   int           `json:"cases"`
	Message string        `json:"message"`
	Details []*CaseResult `json:"details"`
}

func NewBenchmarkResult

func NewBenchmarkResult() *BenchmarkResult

type JobSet

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

func NewJobSet

func NewJobSet(dbFile string) (*JobSet, error)

func (*JobSet) AddJob

func (js *JobSet) AddJob(job *BenchmarkJob) error

func (*JobSet) Close

func (js *JobSet) Close()

func (*JobSet) GetJob

func (js *JobSet) GetJob(jobID int64) *BenchmarkJob

func (*JobSet) ListJobs

func (js *JobSet) ListJobs() []*BenchmarkJob

func (*JobSet) Size

func (js *JobSet) Size() int

type Server

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

func NewServer

func NewServer(cfg *ServerConfig, suites []BenchSuite) (*Server, error)

func (*Server) AbortJob

func (svr *Server) AbortJob(jobID int64, note string) error

func (*Server) AddJob

func (svr *Server) AddJob(meta *BenchmarkMeta) (*BenchmarkJob, error)

func (*Server) Close

func (svr *Server) Close()

func (*Server) GetJob

func (svr *Server) GetJob(jobID int64) *BenchmarkJob

func (*Server) ListJobs

func (svr *Server) ListJobs(lastN int) []*BenchmarkJob

func (*Server) RunJob

func (svr *Server) RunJob(job *BenchmarkJob)

func (*Server) Start

func (svr *Server) Start()

func (*Server) Status

func (svr *Server) Status() *Status

type ServerConfig

type ServerConfig struct {
	Port    int            `toml:"port"`
	Dir     string         `toml:"dir"`
	LogDir  string         `toml:"log_dir"`
	Ansible *AnsibleConfig `toml:"ansible"`
}

func ParseConfig

func ParseConfig(filePath string) (*ServerConfig, error)

type Status

type Status struct {
	TotalCount   int
	RunningCount int
	PendingCount int
}

Jump to

Keyboard shortcuts

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