metric

package
v0.5.7 Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Count

type Count struct {
	StartTime       int64          `json:"startTime"` // 纳秒
	EndTime         int64          `json:"endTime"`   // 纳秒
	Count           int            `json:"count"`
	SuccessCount    int            `json:"successCount"`
	ErrorCount      int            `json:"errorCount"`
	TotalTime       int64          `json:"totalTime"` // 执行时长 从 最小 开始时间 到 最大结束时间 的时间差 纳秒
	Total           string         `json:"total"`     // 执行时长 毫秒 保留 2位小数
	UseTime         int64          `json:"useTime"`   // 总调用时长 使用 所有项 的 耗时 相加
	Use             string         `json:"use"`       // 总调用时长 毫秒 保留 2位小数
	Max             string         `json:"max"`       // 最大时间 毫秒 保留 2位小数
	MaxUseTime      int64          `json:"maxTime"`   // 最大时间 纳秒
	Min             string         `json:"min"`       // 最小时间 毫秒 保留 2位小数
	MinUseTime      int64          `json:"minTime"`   // 最小时间 纳秒
	Tps             string         `json:"tps"`       // TPS 总次数 / 执行时长 秒 保留 2位小数
	TpsValue        float64        `json:"tpsValue"`  // TPS 总次数 / 执行时长 秒
	Avg             string         `json:"avg"`       // 平均耗时 总调用时长 / 总次数 毫秒 保留 2位小数
	AvgValue        float64        `json:"avgValue"`  // 平均耗时 总调用时长 / 总次数 毫秒
	T50             string         `json:"t50"`       // TOP 50 表示 百分之 50 的调用超过这个时间 毫秒 保留 2位小数
	T60             string         `json:"t60"`       // TOP 60 表示 百分之 60 的调用超过这个时间 毫秒 保留 2位小数
	T70             string         `json:"t70"`       // TOP 70 表示 百分之 70 的调用超过这个时间 毫秒 保留 2位小数
	T80             string         `json:"t80"`       // TOP 80 表示 百分之 80 的调用超过这个时间 毫秒 保留 2位小数
	T90             string         `json:"t90"`       // TOP 90 表示 百分之 90 的调用超过这个时间 毫秒 保留 2位小数
	T99             string         `json:"t99"`       // TOP 99 表示 百分之 99 的调用超过这个时间 毫秒 保留 2位小数
	TopItems        []*Item        `json:"topItems"`  // 耗时最高的 10 条记录
	WorkerLossTime  map[int]int64  `json:"workerLossTime"`
	WorkerStartTime map[int]int64  `json:"workerStartTime"`
	WorkerEndTime   map[int]int64  `json:"workerEndTime"`
	WorkerTotalTime map[int]int64  `json:"workerTotalTime"`
	WorkerTotal     map[int]string `json:"workerTotal"`
	// contains filtered or unexported fields
}

func CountItems

func CountItems(itemList ItemList, topCount int) (count *Count)

type Item

type Item struct {
	WorkerIndex int         `json:"workerIndex"` // 工作线程索引  用于并发线程下 每个线程的时间跨度计算
	StartTime   int64       `json:"startTime"`
	EndTime     int64       `json:"endTime"`
	Success     bool        `json:"success"`
	LossTime    int64       `json:"lossTime"` // 损耗时长 纳秒 统计时候将去除该部分时长
	Extend      interface{} `json:"extend"`
	UseTime     int64       `json:"useTime"`
}

func (*Item) End

func (this_ *Item) End(endTime time.Time, err error)

func (*Item) Loss

func (this_ *Item) Loss(lossTime int64)

type ItemList

type ItemList []*Item

func (ItemList) Len

func (m ItemList) Len() int

Len 实现sort.Interface接口的获取元素数量方法

func (ItemList) Less

func (m ItemList) Less(i, j int) bool

Less 实现sort.Interface接口的比较元素方法

func (ItemList) Swap

func (m ItemList) Swap(i, j int)

Swap 实现sort.Interface接口的交换元素方法

type Metric

type Metric struct {
	TopCount int `json:"topCount"`
	// contains filtered or unexported fields
}

func (*Metric) Count

func (this_ *Metric) Count() (count *Count)

func (*Metric) CountMinute

func (this_ *Metric) CountMinute() (counts []*Count)

func (*Metric) CountSecond

func (this_ *Metric) CountSecond() (counts []*Count)

func (*Metric) NewItem

func (this_ *Metric) NewItem(workerIndex int, startTime time.Time) (item *Item)

Jump to

Keyboard shortcuts

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