tools

package
v0.0.0-...-78262f5 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decimal2

func Decimal2(value float64) float64

func FloatToPercent

func FloatToPercent(num float64) string

func GetNowUnix

func GetNowUnix() int64

func GetNowUnixNano

func GetNowUnixNano() int64

func KeyValueRexpGetKV

func KeyValueRexpGetKV(inputsStr string) []string

func Now

func Now() time.Time

func ParseStr

func ParseStr(str string) map[string]string

func ReplaceQmarks

func ReplaceQmarks(str string, new string) string

替换所有的引号

Types

type ControlData

type ControlData struct {
	C            int     //并发数
	N            int     //循环次数
	Total        int     //总计发送次数
	TimeOut      int     //单次请求超时时间
	Target_id    string  //唯一标识
	StartTime    int     //开始运行时间
	EndTime      int     //结束运行时间
	MaxRunTime   int     //最大运行时间
	IsCancel     bool    //是否主动取消
	IsRunning    bool    //是否还在运行
	WorkCnt      int32   //运行的进程数量
	WorkTagetCnt int32   //期望达到进程数
	Cnt          int     //实际完成数量
	FailedCnt    int     //失败的数量
	Size         int     //接收数据量
	CostTime     float64 //实际请求花费时间
	ReportTime   int     //多久汇报一次执行进度,单位毫秒
	LogType      int     //日志类型 0 关闭, 1开启全量 2仅错误日志
	LogFilename  string  //错误日志文件路径
	TestDataPath string  //测试数据路径
}

type ReportControlData

type ReportControlData struct {
	ControlData
	Process float64 //进度
	Qps     float64 //执行次数
	Speed   float64 //下载速度
}

type ReqData

type ReqData struct {
	Url  string
	Body string
}

func GetReqData

func GetReqData(str string) ReqData

Jump to

Keyboard shortcuts

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