biz

package
v0.0.0-...-1b17b00 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MillisecondBucket todo use timeout to calculate( if timeout smaller MillisecondBucket use it!)
	MillisecondBucket int = 5000

	PopWaitSecond                = 10 * time.Second
	EmptyPopSleepTime            = 50 * time.Millisecond
	AggregationEmptyPopSleepTime = 500 * time.Millisecond
	ReportGoroutineNum           = 3
	KST                          = 3
)

Variables

Functions

This section is empty.

Types

type Bucket

type Bucket struct {
	Mark      int
	Count     int64
	Frequency float64
}

type Integrate

type Integrate struct {
	PlanId           uint64
	Tasks            []Task
	StressTime       int32
	StressType       int32
	StressMode       int32
	StepIntervalTime int32
	StartTime        int64
	IntervalLen      int32
	UserId           int64
}

type IntegratorUsecase

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

func NewIntegratorUsecase

func NewIntegratorUsecase(queRepository repo.QueRepository, reporterRepository ReporterRepository,
	recordRepository repo.RecordRepository) *IntegratorUsecase

func (*IntegratorUsecase) IntegrateReport

func (s *IntegratorUsecase) IntegrateReport(ctx context.Context, b *Integrate) error

type LatencyDistribution

type LatencyDistribution struct {
	Percentage    float64
	Latency       int
	PercentageStr string
	LatencyMs     string
}

type Report

type Report struct {
	PlanId    uint64 `json:"plan_id"`
	TaskId    uint64 `json:"task_id"`
	Url       string `json:"url"`
	Timestamp int64  `json:"timestamp"`

	TotalNum                   int64            `json:"total_num"`
	TotalResponseContentLength int64            `json:"total_response_content_length"`
	DurationMap                map[int32]int64  `json:"duration_map"`
	StatusMap                  map[int32]int64  `json:"status_map"`
	ErrorMap                   map[string]int64 `json:"error_map"`
	BodyCheckResultMap         map[string]int64 `json:"body_check_result_map"`
	LatencyMap                 map[string]int32 `json:"latency_map"`
}

type ReporterRepository

type ReporterRepository interface {
	Report(ctx context.Context, detail []*Report) error
}

type Summary

type Summary struct {
	TaskId uint64
	Rps    float64

	AvgTotal      int64
	Fastest       int64
	Slowest       int64
	Average       float64
	ErrorCount    int64
	SizeTotal     int64
	NumRes        int64
	TotalCostTime float64

	TimeBuckets         []int64 `json:"-"`
	StatusCodeDist      map[int]int64
	Histogram           []Bucket
	LatencyDistribution []LatencyDistribution
	ErrorDist           map[string]int64
	BodyCheckResultMap  map[string]int64
}

type Task

type Task struct {
	TaskId               uint64
	Url                  string
	RequestContentLength int
}

Jump to

Keyboard shortcuts

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