jobsvc

package
v0.0.0-...-c0686e8 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2022 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitServiceHandler

func InitServiceHandler(
	d *yarpc.Dispatcher,
	parent tally.Scope,
	jobStore storage.JobStore,
	taskStore storage.TaskStore,
	ormStore *ormobjects.Store,
	jobFactory cached.JobFactory,
	goalStateDriver goalstate.Driver,
	candidate leader.Candidate,
	clientName string,
	jobSvcCfg Config)

InitServiceHandler initializes the job manager

func NewTestServiceHandler

func NewTestServiceHandler() *serviceHandler

NewTestServiceHandler returns an empty new ServiceHandler ptr for testing.

Types

type Config

type Config struct {
	// Maximum number of tasks allowed per job
	MaxTasksPerJob uint32 `yaml:"max_tasks_per_job"`

	// Flag to enable handling peloton secrets
	EnableSecrets bool `yaml:"enable_secrets"`

	// ThemrosExecutor is config used to generate mesos CommandInfo / ExecutorInfo
	// for Thermos executor
	ThermosExecutor config.ThermosExecutorConfig `yaml:"thermos_executor"`

	// T-shirt sizing for instance count in one job, used to determine
	// how many go-routines to run. Higher the instance count, more go-routines
	// to get data faster from DB.
	MedInstanceCount  int `yaml:"med_instance_count"`
	HighInstanceCount int `yaml:"high_instance_count"`

	// Number of go-routines to get workflow events depending on
	// job's instance count
	LowGetWorkflowEventsWorkers  int `yaml:"low_get_workflow_events_workers"`
	MedGetWorkflowEventsWorkers  int `yaml:"med_get_workflow_events_workers"`
	HighGetWorkflowEventsWorkers int `yaml:"high_get_workflow_events_workers"`
}

Config for job service

type Metrics

type Metrics struct {
	JobAPICreate   tally.Counter
	JobCreate      tally.Counter
	JobCreateFail  tally.Counter
	JobAPIGet      tally.Counter
	JobGet         tally.Counter
	JobGetFail     tally.Counter
	JobAPIDelete   tally.Counter
	JobDelete      tally.Counter
	JobDeleteFail  tally.Counter
	JobAPIQuery    tally.Counter
	JobQuery       tally.Counter
	JobQueryFail   tally.Counter
	JobAPIUpdate   tally.Counter
	JobUpdate      tally.Counter
	JobUpdateFail  tally.Counter
	JobAPIRefresh  tally.Counter
	JobRefresh     tally.Counter
	JobRefreshFail tally.Counter
	JobAPIRestart  tally.Counter
	JobRestart     tally.Counter
	JobRestartFail tally.Counter
	JobAPIStart    tally.Counter
	JobStart       tally.Counter
	JobStartFail   tally.Counter
	JobAPIStop     tally.Counter
	JobStop        tally.Counter
	JobStopFail    tally.Counter

	JobAPIGetByRespoolID  tally.Counter
	JobGetByRespoolID     tally.Counter
	JobGetByRespoolIDFail tally.Counter

	// Timers
	JobQueryHandlerDuration tally.Timer

	// TODO: find a better way of organizing metrics per package
	TaskCreate     tally.Counter
	TaskCreateFail tally.Counter
}

Metrics is the struct containing all the counters that track internal state of the job service

func NewMetrics

func NewMetrics(scope tally.Scope) *Metrics

NewMetrics returns a new Metrics struct, with all metrics initialized and rooted at the given tally.Scope

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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