workspacetraffic

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2023 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// AgentID is the workspace agent ID to which to connect.
	AgentID uuid.UUID `json:"agent_id"`

	// AgentName is the name of the agent. Used for metrics.
	AgentName string `json:"agent_name"`

	// WorkspaceName is the name of the workspace. Used for metrics.
	WorkspaceName string `json:"workspace_name"`

	// WorkspaceOwner is the owner of the workspace. Used for metrics.
	WorkspaceOwner string `json:"workspace_owner"`

	// BytesPerTick is the number of bytes to send to the agent per tick.
	BytesPerTick int64 `json:"bytes_per_tick"`

	// Duration is the total duration for which to send traffic to the agent.
	Duration time.Duration `json:"duration"`

	// TickInterval specifies the interval between ticks (that is, attempts to
	// send data to workspace agents).
	TickInterval time.Duration `json:"tick_interval"`

	// Registry is a prometheus.Registerer for logging metrics
	Registry prometheus.Registerer
}

func (Config) Validate

func (c Config) Validate() error

type Metrics added in v0.24.0

type Metrics struct {
	BytesReadTotal      prometheus.CounterVec
	BytesWrittenTotal   prometheus.CounterVec
	ReadErrorsTotal     prometheus.CounterVec
	WriteErrorsTotal    prometheus.CounterVec
	ReadLatencySeconds  prometheus.HistogramVec
	WriteLatencySeconds prometheus.HistogramVec
	LabelNames          []string
}

func NewMetrics added in v0.24.0

func NewMetrics(reg prometheus.Registerer, labelNames ...string) *Metrics

type Runner

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

func NewRunner

func NewRunner(client *codersdk.Client, cfg Config, metrics *Metrics) *Runner

func (*Runner) Cleanup

func (*Runner) Cleanup(context.Context, string) error

Cleanup does nothing, successfully.

func (*Runner) Run

func (r *Runner) Run(ctx context.Context, _ string, logs io.Writer) error

Jump to

Keyboard shortcuts

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