Documentation ¶
Index ¶
- Constants
- Variables
- type AttackReport
- type AttackResult
- type AttackStatistician
- type AttackStatisticsDTO
- func (*AttackStatisticsDTO) Descriptor() ([]byte, []int)deprecated
- func (x *AttackStatisticsDTO) GetFailureBucket() map[string]uint64
- func (x *AttackStatisticsDTO) GetFailures() uint64
- func (x *AttackStatisticsDTO) GetFirstAttack() *timestamppb.Timestamp
- func (x *AttackStatisticsDTO) GetInterval() *durationpb.Duration
- func (x *AttackStatisticsDTO) GetLastAttack() *timestamppb.Timestamp
- func (x *AttackStatisticsDTO) GetMaxResponseTime() *durationpb.Duration
- func (x *AttackStatisticsDTO) GetMinResponseTime() *durationpb.Duration
- func (x *AttackStatisticsDTO) GetName() string
- func (x *AttackStatisticsDTO) GetRecentFailureBucket() map[int64]int64
- func (x *AttackStatisticsDTO) GetRecentSuccessBucket() map[int64]int64
- func (x *AttackStatisticsDTO) GetRequests() uint64
- func (x *AttackStatisticsDTO) GetResponseBucket() map[int64]uint64
- func (x *AttackStatisticsDTO) GetTotalResponseTime() *durationpb.Duration
- func (*AttackStatisticsDTO) ProtoMessage()
- func (x *AttackStatisticsDTO) ProtoReflect() protoreflect.Message
- func (x *AttackStatisticsDTO) Reset()
- func (x *AttackStatisticsDTO) String() string
- type StatisticianGroup
- func (s *StatisticianGroup) Attach(tag Tag)
- func (s *StatisticianGroup) Merge(other *StatisticianGroup)
- func (s *StatisticianGroup) Record(result AttackResult)
- func (s *StatisticianGroup) ReplaceStatistician(agg *AttackStatistician) error
- func (s *StatisticianGroup) Report(full bool) SummaryReport
- func (s *StatisticianGroup) Reset()
- func (s *StatisticianGroup) SetTag(key, value string)
- func (s *StatisticianGroup) Tags() Tags
- type StatisticianGroupDTO
- func (*StatisticianGroupDTO) Descriptor() ([]byte, []int)deprecated
- func (x *StatisticianGroupDTO) GetContainer() map[string]*AttackStatisticsDTO
- func (x *StatisticianGroupDTO) GetTags() []*TagDTO
- func (*StatisticianGroupDTO) ProtoMessage()
- func (x *StatisticianGroupDTO) ProtoReflect() protoreflect.Message
- func (x *StatisticianGroupDTO) Reset()
- func (x *StatisticianGroupDTO) String() string
- type SummaryReport
- type Tag
- type TagDTO
- type Tags
Constants ¶
View Source
const (
CurrentTPSTimeRange = 12 * time.Second
)
Variables ¶
View Source
var File_statistics_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type AttackReport ¶
type AttackReport struct { Name string `json:"name"` // 事务名称 Requests uint64 `json:"requests,omitempty"` // 成功请求总数 Failures uint64 `json:"failures,omitempty"` // 失败请求总数 Min time.Duration `json:"min,omitempty"` // 最小延迟 Max time.Duration `json:"max,omitempty"` // 最大延迟 Median time.Duration `json:"median,omitempty"` // 中位数 Average time.Duration `json:"average,omitempty"` // 平均数 TPS float64 `json:"tps,omitempty"` // 每秒事务数 Distributions map[string]time.Duration `json:"distributions,omitempty"` // 百分位分布 FailRatio float64 `json:"fail_ratio,omitempty"` // 错误率 FailureDetails map[string]uint64 `json:"failure_details,omitempty"` // 错误详情分布 FullHistory bool `json:"full_history"` // 是否是该阶段完整的报告 FirstAttack time.Time `json:"first_attack,omitempty"` // 第一请求发生时间 LastAttack time.Time `json:"last_attack,omitempty"` // 最后一次请求结束时间 }
AttackReport 聚合报告
type AttackResult ¶
AttackResult 事务执行结果
type AttackStatistician ¶
type AttackStatistician struct {
// contains filtered or unexported fields
}
func NewAttackStatistician ¶
func NewAttackStatistician(name string) *AttackStatistician
func NewAttackStatisticianFromDTO ¶
func NewAttackStatisticianFromDTO(dto *AttackStatisticsDTO) (*AttackStatistician, error)
func (*AttackStatistician) BatchMerge ¶
func (ara *AttackStatistician) BatchMerge(others ...*AttackStatistician) error
BatchMerge 合并多个AttackStatistician对象
func (*AttackStatistician) Record ¶
func (ara *AttackStatistician) Record(ret AttackResult)
func (*AttackStatistician) Report ¶
func (ara *AttackStatistician) Report(full bool) AttackReport
type AttackStatisticsDTO ¶
type AttackStatisticsDTO struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Requests uint64 `protobuf:"varint,2,opt,name=requests,proto3" json:"requests,omitempty"` Failures uint64 `protobuf:"varint,3,opt,name=failures,proto3" json:"failures,omitempty"` TotalResponseTime *durationpb.Duration `protobuf:"bytes,4,opt,name=total_response_time,json=totalResponseTime,proto3" json:"total_response_time,omitempty"` MinResponseTime *durationpb.Duration `protobuf:"bytes,5,opt,name=min_response_time,json=minResponseTime,proto3" json:"min_response_time,omitempty"` MaxResponseTime *durationpb.Duration `protobuf:"bytes,6,opt,name=max_response_time,json=maxResponseTime,proto3" json:"max_response_time,omitempty"` RecentSuccessBucket map[int64]int64 `` /* 210-byte string literal not displayed */ RecentFailureBucket map[int64]int64 `` /* 210-byte string literal not displayed */ ResponseBucket map[int64]uint64 `` /* 193-byte string literal not displayed */ FailureBucket map[string]uint64 `` /* 190-byte string literal not displayed */ FirstAttack *timestamppb.Timestamp `protobuf:"bytes,11,opt,name=first_attack,json=firstAttack,proto3" json:"first_attack,omitempty"` LastAttack *timestamppb.Timestamp `protobuf:"bytes,12,opt,name=last_attack,json=lastAttack,proto3" json:"last_attack,omitempty"` Interval *durationpb.Duration `protobuf:"bytes,13,opt,name=interval,proto3" json:"interval,omitempty"` // contains filtered or unexported fields }
func ConvertAttackStatistician ¶
func ConvertAttackStatistician(as *AttackStatistician) (*AttackStatisticsDTO, error)
func (*AttackStatisticsDTO) Descriptor
deprecated
func (*AttackStatisticsDTO) Descriptor() ([]byte, []int)
Deprecated: Use AttackStatisticsDTO.ProtoReflect.Descriptor instead.
func (*AttackStatisticsDTO) GetFailureBucket ¶
func (x *AttackStatisticsDTO) GetFailureBucket() map[string]uint64
func (*AttackStatisticsDTO) GetFailures ¶
func (x *AttackStatisticsDTO) GetFailures() uint64
func (*AttackStatisticsDTO) GetFirstAttack ¶
func (x *AttackStatisticsDTO) GetFirstAttack() *timestamppb.Timestamp
func (*AttackStatisticsDTO) GetInterval ¶
func (x *AttackStatisticsDTO) GetInterval() *durationpb.Duration
func (*AttackStatisticsDTO) GetLastAttack ¶
func (x *AttackStatisticsDTO) GetLastAttack() *timestamppb.Timestamp
func (*AttackStatisticsDTO) GetMaxResponseTime ¶
func (x *AttackStatisticsDTO) GetMaxResponseTime() *durationpb.Duration
func (*AttackStatisticsDTO) GetMinResponseTime ¶
func (x *AttackStatisticsDTO) GetMinResponseTime() *durationpb.Duration
func (*AttackStatisticsDTO) GetName ¶
func (x *AttackStatisticsDTO) GetName() string
func (*AttackStatisticsDTO) GetRecentFailureBucket ¶
func (x *AttackStatisticsDTO) GetRecentFailureBucket() map[int64]int64
func (*AttackStatisticsDTO) GetRecentSuccessBucket ¶
func (x *AttackStatisticsDTO) GetRecentSuccessBucket() map[int64]int64
func (*AttackStatisticsDTO) GetRequests ¶
func (x *AttackStatisticsDTO) GetRequests() uint64
func (*AttackStatisticsDTO) GetResponseBucket ¶
func (x *AttackStatisticsDTO) GetResponseBucket() map[int64]uint64
func (*AttackStatisticsDTO) GetTotalResponseTime ¶
func (x *AttackStatisticsDTO) GetTotalResponseTime() *durationpb.Duration
func (*AttackStatisticsDTO) ProtoMessage ¶
func (*AttackStatisticsDTO) ProtoMessage()
func (*AttackStatisticsDTO) ProtoReflect ¶
func (x *AttackStatisticsDTO) ProtoReflect() protoreflect.Message
func (*AttackStatisticsDTO) Reset ¶
func (x *AttackStatisticsDTO) Reset()
func (*AttackStatisticsDTO) String ¶
func (x *AttackStatisticsDTO) String() string
type StatisticianGroup ¶
type StatisticianGroup struct {
// contains filtered or unexported fields
}
func NewStatisticianGroup ¶
func NewStatisticianGroup() *StatisticianGroup
func NewStatisticianGroupFromDTO ¶
func NewStatisticianGroupFromDTO(dto *StatisticianGroupDTO) (*StatisticianGroup, error)
func (*StatisticianGroup) Merge ¶
func (s *StatisticianGroup) Merge(other *StatisticianGroup)
func (*StatisticianGroup) Record ¶
func (s *StatisticianGroup) Record(result AttackResult)
Record 记录一次请求结果
func (*StatisticianGroup) ReplaceStatistician ¶
func (s *StatisticianGroup) ReplaceStatistician(agg *AttackStatistician) error
ReplaceStatistician 替换某个事务的Statistician
func (*StatisticianGroup) Report ¶
func (s *StatisticianGroup) Report(full bool) SummaryReport
Report 输出统计报表
func (*StatisticianGroup) SetTag ¶
func (s *StatisticianGroup) SetTag(key, value string)
type StatisticianGroupDTO ¶
type StatisticianGroupDTO struct { Container map[string]*AttackStatisticsDTO `` /* 159-byte string literal not displayed */ Tags []*TagDTO `protobuf:"bytes,2,rep,name=tags,proto3" json:"tags,omitempty"` // contains filtered or unexported fields }
func ConvertStatisticianGroup ¶
func ConvertStatisticianGroup(entity *StatisticianGroup) (*StatisticianGroupDTO, error)
func (*StatisticianGroupDTO) Descriptor
deprecated
func (*StatisticianGroupDTO) Descriptor() ([]byte, []int)
Deprecated: Use StatisticianGroupDTO.ProtoReflect.Descriptor instead.
func (*StatisticianGroupDTO) GetContainer ¶
func (x *StatisticianGroupDTO) GetContainer() map[string]*AttackStatisticsDTO
func (*StatisticianGroupDTO) GetTags ¶
func (x *StatisticianGroupDTO) GetTags() []*TagDTO
func (*StatisticianGroupDTO) ProtoMessage ¶
func (*StatisticianGroupDTO) ProtoMessage()
func (*StatisticianGroupDTO) ProtoReflect ¶
func (x *StatisticianGroupDTO) ProtoReflect() protoreflect.Message
func (*StatisticianGroupDTO) Reset ¶
func (x *StatisticianGroupDTO) Reset()
func (*StatisticianGroupDTO) String ¶
func (x *StatisticianGroupDTO) String() string
type SummaryReport ¶
type SummaryReport struct { FirstAttack time.Time `json:"first_attack,omitempty"` LastAttack time.Time `json:"last_attack,omitempty"` TotalRequests uint64 `json:"total_requests,omitempty"` TotalFailures uint64 `json:"total_failures,omitempty"` TotalTPS float64 `json:"total_tps,omitempty"` FullHistory bool `json:"full_history"` Reports map[string]AttackReport `json:"reports,omitempty"` Extras map[string]string `json:"extras,omitempty"` }
type TagDTO ¶
type TagDTO struct { Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
func (*TagDTO) Descriptor
deprecated
func (*TagDTO) ProtoMessage ¶
func (*TagDTO) ProtoMessage()
func (*TagDTO) ProtoReflect ¶
func (x *TagDTO) ProtoReflect() protoreflect.Message
Click to show internal directories.
Click to hide internal directories.