local

package
v0.18.3 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2023 License: Apache-2.0 Imports: 51 Imported by: 0

Documentation

Index

Constants

View Source
const PrometheusURL = "/metrics"

URL on the controller where the metrics are exported in the Prometheus format.

Variables

View Source
var (
	// The directories and files where "weaver gke-local" stores data.
	LogDir      = filepath.Join(runtime.LogsDir(), "gke-local")
	DataDir     = filepath.Join(must(runtime.DataDir()), "gke-local")
	MetricsFile = filepath.Join(DataDir, "metrics.db")
	TracesFile  = filepath.Join(DataDir, "traces.db")
)
View Source
var File_internal_local_local_proto protoreflect.FileDescriptor

Functions

func Controller added in v0.18.0

func Controller(context.Context) (string, *http.Client, error)

Controller returns the address the tool should use to connect to the controller, as well as the HTTP client that can be used to reach it.

func NewPrometheusHandler

func NewPrometheusHandler(db *metricdb.T, logger *slog.Logger) http.Handler

NewPrometheusHandler returns a Prometheus HTTP handler that exports metrics stored in the given metrics database. The returned handler supports the following query parameters:

  • app=<app>, which restricts metrics to the given application, and
  • version=<version>, which restricts metrics to the given app version.

func PrepareRollout

func PrepareRollout(ctx context.Context, cfg *config.GKEConfig) (*controller.RolloutRequest, error)

PrepareRollout returns a new rollout request for the given application version. This call may mutate the passed-in config.

func RecordListener

func RecordListener(ctx context.Context, s store.Store, cfg *config.GKEConfig, lis *nanny.Listener) error

RecordListener records the network listener exported by an application version.

func RunController added in v0.18.0

func RunController(ctx context.Context, region string, port int) error

RunController creates and runs a controller.

func RunDistributor added in v0.18.0

func RunDistributor(ctx context.Context, region string, port, managerPort int) error

RunDistributor creates and runs a distributor.

func RunManager added in v0.18.0

func RunManager(ctx context.Context, region string, port, proxyPort int) error

RunManager creates and runs a manager.

func RunProxy

func RunProxy(ctx context.Context, port int) error

RunProxy creates and runs a proxy listening on ":port".

func Store

func Store(region string) (store.Store, error)

Store returns a store that persists data in the given directory. If the directory does not exist, it is created.

Types

type ListenState

type ListenState struct {

	// Listeners is the set of all exported listeners in the deployment.
	Listeners []*nanny.Listener `protobuf:"bytes,1,rep,name=listeners,proto3" json:"listeners,omitempty"`
	// contains filtered or unexported fields
}

ListenState contains the state stored for the network listeners in the store.

func (*ListenState) Descriptor deprecated

func (*ListenState) Descriptor() ([]byte, []int)

Deprecated: Use ListenState.ProtoReflect.Descriptor instead.

func (*ListenState) GetListeners

func (x *ListenState) GetListeners() []*nanny.Listener

func (*ListenState) ProtoMessage

func (*ListenState) ProtoMessage()

func (*ListenState) ProtoReflect

func (x *ListenState) ProtoReflect() protoreflect.Message

func (*ListenState) Reset

func (x *ListenState) Reset()

func (*ListenState) String

func (x *ListenState) String() string

type Starter

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

Starter starts ReplicaSets on the local machine.

func NewStarter

func NewStarter() (*Starter, error)

NewStarter creates a starter that runs all replicas of a colocation group as OS processes on the local machine.

func (*Starter) Start

func (s *Starter) Start(ctx context.Context, cfg *config.GKEConfig, replicaSetName string) error

Start starts the ReplicaSet for a given deployment.

func (*Starter) Stop

func (s *Starter) Stop(_ context.Context, versions []*config.GKEConfig) error

Stop kills processes in all of the versions' replica sets, blocking until all of the processes are killed.

Directories

Path Synopsis
Package cond implements a context-aware condition variable.
Package cond implements a context-aware condition variable.
Package proxy provides an implementation of a simple proxying service.
Package proxy provides an implementation of a simple proxying service.

Jump to

Keyboard shortcuts

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