executor

package
v0.0.0-...-2eeffc0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2020 License: Apache-2.0 Imports: 20 Imported by: 0

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 Setup

func Setup(groups []metrics.Group) error

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

Types

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) 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) 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