package dto import ( "go-admin/app/observe/models" "go-admin/common/dto" common "go-admin/common/models" ) type ServiceGetEdgesReq struct { models.TimeRange models.WatchLive AppAlias string `uri:"app_alias" form:"app_alias" json:"app_alias" comment:"应用别名"` } type ServiceEdgeRaw struct { SourceService string `ch:"SourceService"` TargetService string `ch:"TargetService"` RequestType string `ch:"RequestType"` TotalNum uint64 `ch:"TotalNum"` Qps float64 `ch:"Qps"` ErrorNum uint64 `ch:"ErrorNum"` ErrorRate float64 `ch:"ErrorRate"` DurationAverage float64 `ch:"DurationAverage"` DurationMedian float64 `ch:"DurationMedian"` DurationP90 float64 `ch:"DurationP90"` DurationP99 float64 `ch:"DurationP99"` Satisfied uint64 `ch:"Satisfied"` Tolerable uint64 `ch:"Tolerable"` Frustrated uint64 `ch:"Frustrated"` Apdex float64 `ch:"Apdex"` } type SerivceGraphNodeRaw struct { ServiceName string `ch:"ServiceName"` TraceNum uint64 `ch:"TraceNum"` SpanNum uint64 `ch:"SpanNum"` SentNum uint64 `ch:"SentNum"` ReceivedNum uint64 `ch:"ReceivedNum"` InternalNum uint64 `ch:"InternalNum"` ErrorNum uint64 `ch:"ErrorNum"` SdkLang string `ch:"SdkLang"` Apdex float64 `ch:"Apdex"` Satisfied uint64 `ch:"satisfied"` Tolerable uint64 `ch:"tolerable"` Frustrated uint64 `ch:"frustrated"` } type SpanScatterChartReq struct { models.TimeRange models.AppPercentileRange models.HourRange AppAlias string `form:"app_alias" json:"app_alias"` ServiceName string `form:"service_name" json:"service_name"` TraceId string `form:"trace_id" json:"trace_id"` //暂时无用 } type ServiceSpansReq struct { models.TimeRange models.DurationRange dto.Pagination AppAlias string `form:"app_alias"` ServiceName []string `form:"service_name"` SpanName string `form:"span_name"` OnlyDatabase bool `form:"only_database"` OnlyException bool `form:"only_exception"` TraceId string `form:"trace_id"` SpanKind string `form:"span_kind"` SpanAttributeKey string `form:"span_attribute_key"` SpanAttributeValue string `form:"span_attribute_value"` RequestMethod string `form:"request_method"` models.SortInfo } type ServiceSpansResp struct { Datetime string `json:"datetime"` Timestamp int64 `json:"timestamp"` TraceId string `json:"trace_id"` SpanId string `json:"span_id"` ServiceName string `json:"service_name"` Method string `json:"method"` Code string `json:"code"` Duration float64 `json:"duration"` } type ServiceJobGenServiceResp struct { NodeResult CreateResult EdgeResult CreateResult } type CreateResult struct { Error string RowsAffected int64 Total int } type ServiceListReq struct { AppId string `form:"app_id"` dto.Pagination } type ServiceUpdateReq struct { Id int `uri:"id" comment:"主键id"` // 主键id AppId int32 `json:"app_id" comment:"应用id"` Name string `json:"name" comment:"url对应的名称"` Kind string `json:"kind" comment:"服务主语言类型"` Type int32 `json:"type" comment:"类型 0.未知 1.对内服务 2.对外服务 3.两者都有"` common.ControlBy } func (s *ServiceUpdateReq) Generate(model *models.ServiceNode) { if s.Id == 0 { model.ID = int32(s.Id) } model.AppID = s.AppId model.Name = s.Name model.Type = s.Type } func (s *ServiceUpdateReq) GetId() interface{} { return s.Id } type ServiceListResp struct { ID int `json:"id"` Name string `json:"name"` ServiceName string `json:"service_name"` AppId int `json:"app_id"` Type int `json:"type"` Kind string `json:"kind"` } type ServiceListNoAppAliasReq struct { _ int `form:"_"` // 这个参数的目的是指明从form中获取参数,如果没有这个参数,下面两个结构体不能获取到数据 models.TimeRange dto.Pagination } type ServiceListNoAppAliasResp struct { ServiceName string `json:"service_name"` TraceTotal int64 `json:"trace_total"` SpanTotal int64 `json:"span_total"` } type ServiceStatsReq struct { ID int64 `form:"id"` ServiceName string `form:"service_name"` AppAlias string `form:"app_alias"` models.TimeRange // dto.Pagination } type ServiceStatsResp struct { ID int64 `json:"id"` ServiceName string `json:"service_name"` Total int64 `json:"total"` Rpm float64 `json:"rpm"` ErrorNum int64 `json:"error_num"` ErrorRate float64 `json:"error_rate"` Max float64 `json:"max"` Avg float64 `json:"avg"` Quantiles Quantiles `json:"quantiles"` // 分位数统计信息 } type ServiceDigitsReq struct { AppAlias string `form:"app_alias"` ServiceName string `form:"service_name"` } type ServiceDigitsResp struct { Span float64 Trace float64 Http float64 Rpc float64 DB float64 Error float64 } type ServiceComponentStats struct { Component string Total int64 ReceivedNum int64 SentNum int64 ErrorNum int64 }