Documentation
¶
Index ¶
- Constants
- type BenchmarkJob
- type BenchmarkMeta
- type BenchmarkResult
- type JobSet
- type Server
- func (svr *Server) AbortJob(jobID int64, note string) error
- func (svr *Server) AddJob(meta *BenchmarkMeta) (*BenchmarkJob, error)
- func (svr *Server) Close()
- func (svr *Server) GetJob(jobID int64) *BenchmarkJob
- func (svr *Server) ListJobs(lastN int) []*BenchmarkJob
- func (svr *Server) RunJob(job *BenchmarkJob)
- func (svr *Server) Start()
- func (svr *Server) Status() *Status
- type ServerConfig
- type Status
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 (*JobSet) AddJob ¶
func (js *JobSet) AddJob(job *BenchmarkJob) error
func (*JobSet) GetJob ¶
func (js *JobSet) GetJob(jobID int64) *BenchmarkJob
func (*JobSet) ListJobs ¶
func (js *JobSet) ListJobs() []*BenchmarkJob
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(cfg *ServerConfig, suites []BenchSuite) (*Server, error)
func (*Server) AddJob ¶
func (svr *Server) AddJob(meta *BenchmarkMeta) (*BenchmarkJob, error)
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)
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)
Click to show internal directories.
Click to hide internal directories.