libOrch

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2023 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultName = "default"
View Source
const GlobalName = "global"

Variables

This section is empty.

Functions

func DispatchMessage

func DispatchMessage(gs BaseGlobalState, message string, messageType string)

func DispatchMessageNoSet

func DispatchMessageNoSet(gs BaseGlobalState, message string, messageType string)

func DispatchWorkerMessage

func DispatchWorkerMessage(gs BaseGlobalState, workerId string, childJobId string, message string, messageType string)

func HandleError

func HandleError(gs BaseGlobalState, err error)

func HandleErrorNoSet

func HandleErrorNoSet(gs BaseGlobalState, err error)

func HandleStringError

func HandleStringError(gs BaseGlobalState, errString string)

func SetInBucket

func SetInBucket(bucket *gridfs.Bucket, filename string, data []byte, contentType string, globeTestLogsReceipt primitive.ObjectID) error

func UpdateStatus

func UpdateStatus(gs BaseGlobalState, status string)

func UpdateStatusNoSet

func UpdateStatusNoSet(gs BaseGlobalState, status string)

Types

type APITeamOptions

type APITeamOptions struct {
	Distribution `json:"distribution"`
}

type BaseGlobalState

type BaseGlobalState interface {
	Ctx() context.Context
	Logger() *logrus.Logger
	OrchestratorClient() *redis.Client
	JobId() string
	OrchestratorId() string
	MetricsStore() *BaseMetricsStore
	GetStatus() string
	SetStatus(string)

	GetChildJobStates() []WorkerState
	SetChildJobState(workerId string, childJobId string, status string)
	CreditsManager() *lib.CreditsManager
	Standalone() bool
	FuncMode() bool
	FuncAuthClient() FunctionAuthClient
}

type BaseMetricsStore

type BaseMetricsStore interface {
	InitMetricsStore(options *libWorker.Options)
	AddMessage(message WorkerMessage, workerLocation string, subFraction float64) error
	Stop()
	FlushMetrics()
}

Cached metrics are stored before being collated and sent

type ChildJob

type ChildJob struct {
	Job
	ChildJobId        string                 `json:"childJobId"`
	Options           libWorker.Options      `json:"options"`
	UnderlyingRequest map[string]interface{} `json:"underlyingRequest"`
	FinalRequest      map[string]interface{} `json:"finalRequest"`
	SubFraction       float64                `json:"subFraction"`
}

type CollectionContext

type CollectionContext struct {
	Variables []libWorker.KeyValueItem `json:"variables"`
	Name      string                   `json:"name"`
}

type Distribution

type Distribution struct {
	LoadZone string `json:"loadZone"`
	Percent  int    `json:"percent"`
}

type EnvironmentContext

type EnvironmentContext struct {
	Variables []libWorker.KeyValueItem `json:"variables"`
	Name      string                   `json:"name"`
}

type FunctionAuthClient added in v0.1.1

type FunctionAuthClient interface {
	Functions() []LiveFunction
	ExecuteFunction(location string, childJobPayload ChildJob) (*(chan FunctionResult), error)
	CheckFunctionAvailability(location string) error
}

type FunctionResult added in v0.1.1

type FunctionResult struct {
	Response *http.Response
	Error    error
}

type Job

type Job struct {
	Id                     string                 `json:"id"`
	Source                 string                 `json:"source"`
	SourceName             string                 `json:"sourceName"`
	EnvironmentContext     *EnvironmentContext    `json:"environmentContext"`
	CollectionContext      *CollectionContext     `json:"collectionContext"`
	UnderlyingRequest      map[string]interface{} `json:"underlyingRequest"`
	FinalRequest           map[string]interface{} `json:"finalRequest"`
	AssignedOrchestrator   string                 `json:"assignedOrchestrator"`
	Scope                  Scope                  `json:"scope"`
	Options                *libWorker.Options     `json:"options"`
	VerifiedDomains        []string               `json:"verifiedDomains"`
	FuncModeInfo           *lib.FuncModeInfo      `json:"funcModeInfo"`
	PermittedLoadZones     []string               `json:"permittedLoadZones"`
	MaxTestDurationMinutes int64                  `json:"maxTestDurationMinutes"`
	MaxSimulatedUsers      int64                  `json:"maxSimulatedUsers"`
}

type LiveFunction added in v0.1.1

type LiveFunction struct {
	Location string
	Uri      string
	State    functionspb.Function_State
}

type LocalhostFile

type LocalhostFile struct {
	FileName string `json:"fileName"`
	Contents string `json:"contents"`
	Kind     string `json:"kind"`
}

type MarkMessage

type MarkMessage struct {
	Mark    string      `json:"mark"`
	Message interface{} `json:"message"`
}

type NamedClient

type NamedClient struct {
	Name   string
	Client *redis.Client
}

type OrchestratorMessage

type OrchestratorMessage struct {
	JobId          string    `json:"jobId"`
	Time           time.Time `json:"time"`
	OrchestratorId string    `json:"orchestratorId"`
	Message        string    `json:"message"`
	MessageType    string    `json:"messageType"`
}

type OrchestratorOrWorkerMessage

type OrchestratorOrWorkerMessage struct {
	JobId          string    `json:"jobId"`
	Time           time.Time `json:"time"`
	ChildJobId     string    `json:"childJobId"`
	OrchestratorId string    `json:"orchestratorId"`
	WorkerId       string    `json:"workerId"`
	Message        string    `json:"message"`
	MessageType    string    `json:"messageType"`
}

type Scope

type Scope struct {
	Variant         string `json:"variant"`
	VariantTargetId string `json:"variantTargetId"`
}

type WorkerClients

type WorkerClients struct {
	Clients       map[string]*NamedClient
	DefaultClient *NamedClient
}

type WorkerMessage

type WorkerMessage struct {
	JobId       string    `json:"jobId"`
	ChildJobId  string    `json:"childJobId"`
	Time        time.Time `json:"time"`
	WorkerId    string    `json:"workerId"`
	Message     string    `json:"message"`
	MessageType string    `json:"messageType"`
}

type WorkerState

type WorkerState struct {
	Status     string `json:"status"`
	WorkerId   string `json:"workerId"`
	ChildJobId string `json:"childJobId"`
}

Jump to

Keyboard shortcuts

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