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 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
在指定时间内,循环调用回调函数,输出统计数据。
Click to show internal directories.
Click to hide internal directories.