biz.go 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. package dto
  2. import (
  3. "go-admin/app/observe/models"
  4. "go-admin/common/dto"
  5. )
  6. type BizListReq struct {
  7. dto.Pagination `search:"-"`
  8. AppId string `form:"app_id"`
  9. AppAlias string `form:"app_alias"`
  10. ServiceName string `form:"service_name"`
  11. Route string `form:"route"`
  12. models.TimeRange
  13. }
  14. type BizListResp struct {
  15. // 基础信息
  16. ID int64 `json:"id"`
  17. Name string `json:"name"`
  18. AppId int64 `json:"app_id"`
  19. ServiceName string `json:"service_name"`
  20. ServiceNameCN string `json:"service_name_cn"`
  21. SpanName string `json:"span_name"`
  22. Total int64 `json:"total"`
  23. Rpm float64 `json:"rpm"`
  24. ErrorNum int64 `json:"error_num"`
  25. ErrorRate float64 `json:"error_rate"`
  26. Max float64 `json:"max"`
  27. Min float64 `json:"min"`
  28. Avg float64 `json:"avg"`
  29. Favor int8 `json:"favor"`
  30. Quantiles Quantiles `json:"quantiles"`
  31. // 基础统计信息
  32. // Total int64 `json:"total"`
  33. // Rpm float64 `json:"rpm"`
  34. // ErrorNum int64 `json:"error_num"`
  35. // ErrorRate float64 `json:"error_rate"`
  36. // Max float64 `json:"max"`
  37. // Min float64 `json:"min"`
  38. // Avg float64 `json:"avg"`
  39. // 分位数统计信息
  40. // DurationStats BizListQuantile `json:"duration_stats"`
  41. }
  42. type BizBasicGuy struct {
  43. AppAlias string `form:"app_alias"`
  44. }
  45. type BizStatsReq struct {
  46. BizId string `form:"biz_id"`
  47. BizHash string `form:"biz_hash"`
  48. models.TimeRange
  49. }
  50. type BizStatsResp struct {
  51. BizId int64 `json:"biz_id"`
  52. BizHash string `json:"biz_hash"`
  53. Total int64 `json:"total"`
  54. Rpm float64 `json:"rpm"`
  55. ErrorNum int64 `json:"error_num"`
  56. ErrorRate float64 `json:"error_rate"`
  57. Max float64 `json:"max"`
  58. // Min float64 `json:"min"`
  59. Avg float64 `json:"avg"`
  60. Quantiles Quantiles `json:"quantiles"` // 分位数统计信息
  61. }
  62. type BizDetailReq struct {
  63. dto.Pagination `search:"-"`
  64. BizId string `form:"biz_id"`
  65. OnlyException bool `form:"only_exception"`
  66. models.DurationRange
  67. models.TimeRange
  68. models.SortInfo
  69. // Sort string `form:"sort"`
  70. }
  71. type BizDetailResp struct {
  72. Datetime string `json:"datetime"`
  73. Timestamp int64 `json:"timestamp"`
  74. TraceId string `json:"trace_id"`
  75. SpanId string `json:"span_id"`
  76. SpanName string `json:"span_name"`
  77. Duration int64 `json:"duration"`
  78. }
  79. type BizGraphReq struct {
  80. BizId string `form:"biz_id"`
  81. models.TimeRange
  82. }
  83. type BizGraphResp struct {
  84. // models.BizNode
  85. ID int64 `json:"id"`
  86. Name string `json:"name"`
  87. UniqueID string `json:"unique_id"`
  88. Type int64 `json:"node_type"`
  89. BizHash string `json:"biz_hash"`
  90. AppAlias string `json:"app_alias"`
  91. ServiceName string `json:"service_name"`
  92. ServiceNameCN string `json:"service_name_cn"`
  93. SpanName string `json:"span_name"`
  94. SpanKind string `json:"span_kind"`
  95. SpanType string `json:"span_type"`
  96. IsVirtual int64 `json:"is_virtual"`
  97. Stats *BizGraphStatsResp `json:"stats"`
  98. Children []*BizGraphResp `json:"children"`
  99. MaxDepth int64 `json:"max_depth"`
  100. }
  101. type BizGraphStatsReq struct {
  102. BizNodeId int64 `form:"biz_node_id"`
  103. models.TimeRange
  104. }
  105. type BizGraphStatsResp struct {
  106. BizNodeId int64 `json:"biz_node_id"`
  107. Duration float64 `json:"duration"`
  108. SuccessRate float64 `json:"success_rate"`
  109. SuccessRateUp bool `json:"success_rate_up"`
  110. }
  111. type BizDigitsReq struct {
  112. AppId int64 `form:"app_id"`
  113. AppAlias string `form:"app_alias"`
  114. models.TimeRange
  115. }
  116. type BizDigitsResp struct {
  117. Biz int64 `json:"biz"`
  118. Service int64 `json:"service"`
  119. Error int64 `json:"error"`
  120. ErrorPerMinute float64 `json:"error_per_minute"`
  121. ErrorRate float64 `json:"error_rate"`
  122. Trace float64 `json:"trace"`
  123. TracePerMinute float64 `json:"trace_per_minute"`
  124. DatabaseBiz int64 `json:"database_biz"`
  125. DatabaseBizPerMinute float64 `json:"database_biz_per_minute"`
  126. }
  127. type BizMarkReq struct {
  128. Id int64 `uri:"id"`
  129. Name string `form:"name"`
  130. }
  131. type BizFavorReq struct {
  132. Id int64 `uri:"id"`
  133. Favor int8 `form:"favor"`
  134. }
  135. type BizDeleteReq struct {
  136. Id int64 `uri:"id"`
  137. }
  138. type BizNodeSpansReq struct {
  139. ID int64 `form:"id"`
  140. Hash string `form:"hash"`
  141. models.TimeRange
  142. dto.Pagination `search:"-"`
  143. models.SortInfo
  144. }
  145. type BizNodeStatsReq struct {
  146. ID int64 `form:"id"`
  147. Hash string `form:"hash"`
  148. models.TimeRange
  149. }
  150. type BizNodeStatsResp struct {
  151. ID int64 `json:"id"`
  152. Hash string `json:"hash"`
  153. Total int64 `json:"total"` // 结点span总量(区间内)
  154. ErrorRate float64 `json:"error_rate"`
  155. P50 float64 `json:"p50"`
  156. P90 float64 `json:"p90"`
  157. P99 float64 `json:"p99"`
  158. Name string `json:"name"` // 当前为接口名, 后面可能为rpc名, 函数名等
  159. Value string `json:"value"` // 当前为接口地址, 后面可能为rpc地址等
  160. ServiceName string `json:"service_name"`
  161. HttpMethod string `json:"http_method"`
  162. DurationStats DurationStats `json:"duration_stats"`
  163. }
  164. type BizNodeUpdateReq struct {
  165. ID int64 `form:"id"`
  166. Hash string `form:"hash"`
  167. Name string `form:"name"`
  168. }
  169. type BizSlowTopReq struct {
  170. AppAlias string `form:"app_alias"`
  171. Limit int64 `form:"limit"`
  172. models.TimeRange
  173. }
  174. type BizSlowTopResp struct {
  175. BizId int64 `json:"biz_id"`
  176. BizName string `json:"biz_name"`
  177. BizHash string `json:"biz_hash"`
  178. AppAlias string `json:"app_alias"`
  179. ServiceName string `json:"service_name"`
  180. ServiceNameCN string `json:"service_name_cn"`
  181. SpanName string `json:"span_name"`
  182. SpanKind string `json:"span_kind"`
  183. ErrorRate float64 `json:"error_rate"`
  184. Duration float64 `json:"duration"`
  185. }