Documentation
¶
Index ¶
- func TemplateTarData(numPresets, numPresetPrebuilds int) ([]byte, error)
- type Config
- type Metrics
- func (m *Metrics) AddError(templateName string, action string)
- func (m *Metrics) SetDeletionJobsCompleted(count int, templateName string)
- func (m *Metrics) SetDeletionJobsCreated(count int, templateName string)
- func (m *Metrics) SetDeletionJobsFailed(count int, templateName string)
- func (m *Metrics) SetDeletionJobsRunning(count int, templateName string)
- func (m *Metrics) SetJobsCompleted(count int, templateName string)
- func (m *Metrics) SetJobsCreated(count int, templateName string)
- func (m *Metrics) SetJobsFailed(count int, templateName string)
- func (m *Metrics) SetJobsRunning(count int, templateName string)
- type Runner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TemplateTarData ¶
Types ¶
type Config ¶
type Config struct {
// OrganizationID is the ID of the organization to create the prebuilds in.
OrganizationID uuid.UUID `json:"organization_id"`
// NumPresets is the number of presets the template should have.
NumPresets int `json:"num_presets"`
// NumPresetPrebuilds is the number of prebuilds per preset.
// Total prebuilds = NumPresets * NumPresetPrebuilds
NumPresetPrebuilds int `json:"num_preset_prebuilds"`
// TemplateVersionJobTimeout is how long to wait for template version
// provisioning jobs to complete.
TemplateVersionJobTimeout time.Duration `json:"template_version_job_timeout"`
// PrebuildWorkspaceTimeout is how long to wait for all prebuild
// workspaces to be created and completed.
PrebuildWorkspaceTimeout time.Duration `json:"prebuild_workspace_timeout"`
Metrics *Metrics `json:"-"`
// SetupBarrier is used to ensure all templates have been created
// before unpausing prebuilds.
SetupBarrier *sync.WaitGroup `json:"-"`
// CreationBarrier is used to ensure all prebuild creation has completed
// before pausing prebuilds for deletion.
CreationBarrier *sync.WaitGroup `json:"-"`
// DeletionSetupBarrier is used by the runner owner (CLI/test) to signal when
// prebuilds have been paused, allowing runners to create new template versions
// with 0 prebuilds. Only the owner calls Done(), runners only Wait().
DeletionSetupBarrier *sync.WaitGroup `json:"-"`
// DeletionBarrier is used to ensure all templates have been updated
// with 0 prebuilds before resuming prebuilds.
DeletionBarrier *sync.WaitGroup `json:"-"`
Clock quartz.Clock `json:"-"`
}
type Metrics ¶
type Metrics struct {
PrebuildJobsCreated prometheus.GaugeVec
PrebuildJobsRunning prometheus.GaugeVec
PrebuildJobsFailed prometheus.GaugeVec
PrebuildJobsCompleted prometheus.GaugeVec
PrebuildDeletionJobsCreated prometheus.GaugeVec
PrebuildDeletionJobsRunning prometheus.GaugeVec
PrebuildDeletionJobsFailed prometheus.GaugeVec
PrebuildDeletionJobsCompleted prometheus.GaugeVec
PrebuildErrorsTotal prometheus.CounterVec
}
func NewMetrics ¶
func NewMetrics(reg prometheus.Registerer) *Metrics
func (*Metrics) SetDeletionJobsCompleted ¶
func (*Metrics) SetDeletionJobsCreated ¶
func (*Metrics) SetDeletionJobsFailed ¶
func (*Metrics) SetDeletionJobsRunning ¶
func (*Metrics) SetJobsCompleted ¶
func (*Metrics) SetJobsCreated ¶
func (*Metrics) SetJobsFailed ¶
func (*Metrics) SetJobsRunning ¶
Click to show internal directories.
Click to hide internal directories.