Movatterモバイル変換


[0]ホーム

URL:


autostart

package
v2.28.4Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2025 License:AGPL-3.0Imports:15Imported by:0

Details

Repository

github.com/coder/coder

Links

Documentation

Index

Constants

View Source
const (AutostartTotalLatencyMetric       = "autostart_total_latency_seconds"AutostartJobCreationLatencyMetric = "autostart_job_creation_latency_seconds"AutostartJobAcquiredLatencyMetric = "autostart_job_acquired_latency_seconds")

Variables

This section is empty.

Functions

This section is empty.

Types

typeConfig

type Config struct {// User is the configuration for the user to create.Usercreateusers.Config `json:"user"`// Workspace is the configuration for the workspace to create. The workspace// will be built using the new user.//// OrganizationID is ignored and set to the new user's organization ID.Workspaceworkspacebuild.Config `json:"workspace"`// WorkspaceJobTimeout is how long to wait for any one workspace job// (start or stop) to complete.WorkspaceJobTimeouttime.Duration `json:"workspace_job_timeout"`// AutostartDelay is how long after all the workspaces have been stopped// to schedule them to be started again.AutostartDelaytime.Duration `json:"autostart_delay"`// AutostartTimeout is how long to wait for the autostart build to be// initiated after the scheduled time.AutostartTimeouttime.Duration `json:"autostart_timeout"`Metrics *Metrics `json:"-"`// SetupBarrier is used to ensure all runners own stopped workspaces// before setting the autostart schedule on each.SetupBarrier *sync.WaitGroup `json:"-"`}

func (Config)Validate

func (cConfig) Validate()error

typeMetrics

type Metrics struct {AutostartJobCreationLatencySecondsprometheus.HistogramVecAutostartJobAcquiredLatencySecondsprometheus.HistogramVecAutostartTotalLatencySecondsprometheus.HistogramVecAutostartErrorsTotalprometheus.CounterVec}

funcNewMetrics

func NewMetrics(regprometheus.Registerer) *Metrics

func (*Metrics)AddError

func (m *Metrics) AddError(usernamestring, actionstring)

func (*Metrics)RecordCompletion

func (m *Metrics) RecordCompletion(elapsedtime.Duration, usernamestring, workspacestring)

func (*Metrics)RecordJobAcquired

func (m *Metrics) RecordJobAcquired(elapsedtime.Duration, usernamestring, workspacestring)

func (*Metrics)RecordJobCreation

func (m *Metrics) RecordJobCreation(elapsedtime.Duration, usernamestring, workspacestring)

typeRunner

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

funcNewRunner

func NewRunner(client *codersdk.Client, cfgConfig) *Runner

func (*Runner)Cleanup

func (r *Runner) Cleanup(ctxcontext.Context, idstring, logsio.Writer)error

func (*Runner)GetMetrics

func (r *Runner) GetMetrics() map[string]any

func (*Runner)Run

func (r *Runner) Run(ctxcontext.Context, idstring, logsio.Writer)error

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp