Documentation ¶
Index ¶
- Constants
- Variables
- func Nanny(context.Context) (string, *http.Client, error)
- func NewPrometheusHandler(db *metricdb.T, logger *slog.Logger) http.Handler
- func PrepareRollout(ctx context.Context, cfg *config.GKEConfig) (*controller.RolloutRequest, *http.Client, error)
- func RecordListener(ctx context.Context, s store.Store, cfg *config.GKEConfig, lis *nanny.Listener) error
- func RunNanny(ctx context.Context, opts NannyOptions) error
- func RunProxy(ctx context.Context, port int) error
- func Store(region string) (store.Store, error)
- type ListenState
- type NannyOptions
- type Starter
Constants ¶
const PrometheusURL = "/metrics"
URL on the controller where the metrics are exported in the Prometheus format.
Variables ¶
var File_internal_local_local_proto protoreflect.FileDescriptor
var LogDir = filepath.Join(logging.DefaultLogDir, "weaver-gke-local")
LogDir is where weaver-gke-local deployed applications store their logs.
Functions ¶
func Nanny ¶
Nanny returns the nanny address, along with the HTTP client that can be used to reach it.
func NewPrometheusHandler ¶
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, *http.Client, error)
PrepareRollout returns a new rollout request for the given application version, along with the HTTP client that should be used to reach it. May mutate the passed-in run.
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 RunNanny ¶
func RunNanny(ctx context.Context, opts NannyOptions) error
RunNanny creates and runs a nanny.
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 NannyOptions ¶
type NannyOptions struct { Region string // simulated GKE region (e.g., us-central1) StartController bool // start a controller? StartDistributor bool // start a distributor/manager? Port int // listen on localhost:port }
NannyOptions configure a nanny.
type Starter ¶
type Starter struct {
// contains filtered or unexported fields
}
Starter starts ReplicaSets on the local machine.
func NewStarter ¶
NewStarter creates a starter that runs all replicas of a colocation group as OS processes on the local machine.
func (*Starter) Babysitters ¶
func (s *Starter) Babysitters() []*babysitter.Babysitter
Babysitters returns a snapshot of all currently running babysitters.