_test

package
v0.0.0-...-256bcdb Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2024 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MySqlDsn     = "root:123456>>@tcp(127.0.0.1:3306)/easygo?timeout=3s&charset=utf8mb4&loc=Local"
	RabbitMQAddr = "amqp://guest:guest@127.0.0.1:5672"
	KafkaAddr    = "127.0.0.1:9092"
	InfluxAddr   = "http://127.0.0.1:8086"
)

Functions

This section is empty.

Types

type PerfOptions

type PerfOptions struct {
	Name      string
	Dur       time.Duration
	Goroutine int
	NoHead    bool
}

type PerfResult

type PerfResult struct {
	Took time.Duration `json:"took,omitempty"` //
	Ok   int32         `json:"ok,omitempty"`   //
	Fail int32         `json:"fail,omitempty"` //
	MRT  time.Duration `json:"mrt,omitempty"`  // Mean Response Time,平均响应时间
	QPS  float64       `json:"qps,omitempty"`  // Request Per Second,平均每秒请求次数
}

func Perf

func Perf(f func(i int), opt ...PerfOptions) *PerfResult

func PerfIf

func PerfIf(f func(i int) (ok bool), opt ...PerfOptions) *PerfResult

在指定时间内,循环调用回调函数,输出统计数据。

Jump to

Keyboard shortcuts

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