report_summary.go 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. package model
  2. import (
  3. "time"
  4. )
  5. //ReportSummary report summary
  6. type ReportSummary struct {
  7. ID int `json:"id" gorm:"AUTO_INCREMENT;primary_key;" form:"id"`
  8. ScriptID int `json:"script_id" form:"script_id"`
  9. ScriptSnapID int `json:"script_snap_id" form:"script_snap_id"`
  10. ExecuteID string `json:"execute_id" form:"execute_id"`
  11. Department string `json:"department" form:"department"`
  12. Project string `json:"project" form:"project"`
  13. APP string `json:"app" form:"app"`
  14. TestName string `json:"test_name" form:"test_name" param:"test_name"`
  15. TestNameNick string `json:"test_name_nick" form:"test_name_nick"`
  16. JobName string `json:"job_name" form:"job_name"`
  17. Count int `json:"count"`
  18. QPS int `json:"qps"`
  19. AvgTime int `json:"avg_time"`
  20. Min int `json:"min"`
  21. Max int `json:"max"`
  22. Error int `json:"error"`
  23. FailPercent string `json:"fail_percent"`
  24. NinetyTime int `json:"ninety_time"`
  25. NinetyFiveTime int `json:"ninety_five_time"`
  26. NinetyNineTime int `json:"ninety_nine_time"`
  27. NetIo int `json:"net_io"`
  28. ElapsdTime int `json:"elapsd_time"`
  29. TestStatus int `json:"test_status"`
  30. UserName string `json:"user_name" form:"user_name"`
  31. ResJtl string `json:"res_jtl"`
  32. JmeterLog string `json:"jmeter_log"`
  33. DockerSum int `json:"docker_sum"`
  34. Ctime time.Time `json:"ctime"`
  35. Mtime time.Time `json:"mtime"`
  36. Debug int `json:"debug"`
  37. Active int `json:"active" form:"active"`
  38. SceneID int `json:"scene_id" form:"scene_id"`
  39. Type int `json:"type" form:"type"` // 0.http单接口 1.grpc报告 2.场景报告 3.全链路
  40. LoadTime int `json:"load_time"` //执行时间
  41. FiftyTime int `json:"fifty_time"`
  42. IsFusing bool `json:"is_fusing"` //是否熔断
  43. FusingTestName string `json:"fusing_test_name"` //被熔断接口
  44. SuccessCodeRate int `json:"success_code_rate"` //熔断时接口的httpcode
  45. SuccessBusinessRate int `json:"success_business_rate"` //熔断时接口的成功率
  46. FusingValue int `json:"fusing_value"` //熔断阈值
  47. BusinessValue int `json:"business_value"` //业务熔断阈值
  48. UseBusinessStop bool `json:"use_business_stop"` //是否使用业务熔断
  49. }
  50. //QueryReportSuRequest query report summary request
  51. type QueryReportSuRequest struct {
  52. ReportSummary
  53. //Script
  54. Pagination
  55. Executor string `json:"executor" form:"executor"`
  56. SearchAll bool `json:"search_all" form:"search_all"`
  57. }
  58. //QueryReportSuResponse query report summary response
  59. type QueryReportSuResponse struct {
  60. ReportSummarys []*ReportLabels `json:"reports"`
  61. Pagination
  62. }
  63. //ReportLabels report labels
  64. type ReportLabels struct {
  65. ReportSummary
  66. Labels []*LabelRelation `json:"labels"`
  67. }
  68. //TableName tablename
  69. func (r ReportSummary) TableName() string {
  70. return "report_summary"
  71. }