lib

package
v0.0.0-...-fb4b340 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ConnectionErrors int32 = 0
	ReadErrors       int32 = 0
	WriteErrors      int32 = 0
)

Total connection error

Functions

func Bites

func Bites(s int64) string

func Bytes

func Bytes(s int64) string

func NewThread

func NewThread(config *Config)

func PrintStats

func PrintStats(w io.Writer, config *Config)

Print all statistic

func RoundFloat

func RoundFloat(x float64, prec int) float64

func Start

func Start(cfg Config)

func StartStatsAggregator

func StartStatsAggregator(config *Config)

Stat aggregator

Types

type Config

type Config struct {
	Method         string
	Header         map[string][]string
	URL            *url.URL
	Data           []byte
	Connections    int
	Threads        int
	MRQ            int
	Verbose        bool
	ExcludeSeconds time.Duration

	Duration time.Duration

	WriteCPUProfileToFile string
	// contains filtered or unexported fields
}

type Connection

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

func (*Connection) Dial

func (this *Connection) Dial() error

func (*Connection) Exec

func (this *Connection) Exec(req *http.Request, resp chan *RequestStats)

func (*Connection) IsConnected

func (this *Connection) IsConnected() bool

func (*Connection) Return

func (this *Connection) Return()

func (*Connection) Take

func (this *Connection) Take()

type ConnectionManager

type ConnectionManager struct {
	C chan *Connection
	// contains filtered or unexported fields
}

func NewConnectionManager

func NewConnectionManager(config *Config) (result *ConnectionManager)

type RequestStats

type RequestStats struct {
	ResponseCode int
	Duration     time.Duration
	NetIn        int64
	NetOut       int64
}

type Source

type Source struct {
	Data []byte
}

type SpacesFormat

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

Format with space prefix

func (SpacesFormat) String

func (this SpacesFormat) String() string

type StatsSource

type StatsSource struct {
	Readed          int64
	Writed          int64
	Requests        int
	Skiped          int
	Min             time.Duration
	Max             time.Duration
	Sum             int64
	Codes           map[int]int
	DurationPercent map[time.Duration]int
	ReadErrors      int
	WriteErrors     int
	Work            time.Duration
}

Statistic data

type StatsSourcePerSecond

type StatsSourcePerSecond struct {
	Readed   int64
	Writed   int64
	Requests int
	Skiped   int
	Sum      int64
}

Statistic data for verbose mode

Jump to

Keyboard shortcuts

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