publish

package
v0.0.0-...-dfa80c7 Latest Latest
Warning

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

Go to latest
Published: May 7, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Server *Server
}

Command represents the command executed by `go run pub_benchmark.go`

func (*Command) ParseFlags

func (cmd *Command) ParseFlags(args ...string) (Options, error)

ParseFlags parses the args into Options.

func (*Command) Run

func (cmd *Command) Run(args ...string) error

Run parses the command arguments and starts the server.

type Options

type Options struct {
	Host               string //default:  localhost
	Port               string //default: :1883
	Username           string
	Password           string
	Qos                int
	Topic              string
	ConnectionInterval int
	PublishInterval    int //
	Number             int //number of messages  to publish per client
	Count              int //number of clients
	Size               int //payload bytes, default to 256
	SubCount           int //number of clients which subscribe topic # , default to 0
	SubQos             int //qos level of subscriptions, default to 0
	CleanSession       bool
	Time               int //timeout
}

Options represents the publish benchmark options

type Server

type Server struct {
	Options Options

	StartAt    time.Time
	FinishedAt time.Time
	// contains filtered or unexported fields
}

Server represents the publish benchmark server.

func (*Server) Run

func (srv *Server) Run(ctx context.Context)

Run starts the server.

Jump to

Keyboard shortcuts

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