executor

package
v0.0.0-...-37de26c Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2023 License: Apache-2.0 Imports: 20 Imported by: 1

Documentation

Index

Constants

View Source
const (
	Idle     status = "idle"
	Running  status = "running"
	Finished status = "finished"
)

Variables

View Source
var (
	ErrIDNotFound    = errors.New("id not found")
	ErrNodeIsRunning = errors.New("driver is running")

	ErrAppCancel = errors.New("application is cancel")
	ErrAppPanic  = errors.New("application is panic")
)

Error

Functions

func Generate

func Generate(wr io.Writer, appID int) (err error)

Generate creates an executor go file that is used to compiled to a binary

func Notify

func Notify(title string, value int64) error

Notify saves the id with value into metrics which later save to database Return error when the title is not found from the metric list. The not found error may occur because a. The title has never ever register before b. The session is cancel but the scenario does not handle the ctx.Done signal

func SetClientConnect

func SetClientConnect(cc ClientConnector) error

SetClientConnect setup new clientConnectInstance. Use to support testing only

func Setup

func Setup(groups []metrics.Group) error

Setup is used for the driver to report the metrics that it will generate

Types

type ClientConnector

type ClientConnector interface {
	Setup(groups []metrics.Group) error
	Notify(title string, value int64) error
}

type Executor

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

Executor struct

func NewExecutor

func NewExecutor(opts *Options, logger logger.Logger) (e *Executor, err error)

NewExecutor creates a new executor also load the plugin from driver path

func (*Executor) Notify

func (e *Executor) Notify(title string, value int64) error

Notify saves the id with value into metrics which later save to database Return error when the title is not found from the metric list. The not found error may occur because a. The title has never ever register before b. The session is cancel but the scenario does not handle the ctx.Done signal

func (*Executor) Serve

func (e *Executor) Serve() (err error)

Serve starts a rpc server at the executor socket and connects to the agent via agent socket

func (*Executor) Setup

func (e *Executor) Setup(groups []metrics.Group) error

Setup is used for the driver to report the metrics that it will generate

func (*Executor) Start

func (m *Executor) Start(ctx context.Context, req *pb.StartRequest) (*pb.StartResult, error)

Start begins to run the program

func (*Executor) Terminate

func (m *Executor) Terminate(ctx context.Context, req *pb.TermRequest) (*pb.TermResult, error)

Terminate shutdown this executor process

type Options

type Options struct {
	AgentSock    string
	ExecutorSock string
	AppID        int
	Vus          scenario.Vus
}

Options is for creating new executor object

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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