ptestjob.go 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. package model
  2. import "time"
  3. //PtestJob performance test job
  4. type PtestJob struct {
  5. ID int `json:"id" gorm:"AUTO_INCREMENT;primary_key;" form:"id"`
  6. ScriptID int `json:"script_id" form:"script_id"`
  7. ReportSuID int `json:"report_su_id" form:"report_su_id"`
  8. JobName string `json:"job_name" form:"job_name"`
  9. Active int `json:"active" form:"active"`
  10. ExecuteID string `json:"execute_id" form:"execute_id"`
  11. HostIP string `json:"host_ip"`
  12. JobIP string `json:"job_ip"`
  13. JobID string `json:"job_id"`
  14. Ctime time.Time `json:"ctime"`
  15. Mtime time.Time `json:"mtime"`
  16. }
  17. //PtestAdd model for adding performance test job
  18. type PtestAdd struct {
  19. ReportSuID int `json:"report_su_id" form:"report_su_id"`
  20. ScriptID int `json:"script_id" form:"script_id"`
  21. JmeterLog string `json:"jmeter_log" form:"jmeter_log"`
  22. ResJtl string `json:"res_jtl" form:"res_jtl"`
  23. JobName string `json:"job_name" form:"job_name"`
  24. DockerSum int `json:"docker_sum" form:"docker_sum"`
  25. ScriptType int `json:"script_type" form:"script_type"`
  26. ExecuteID string `json:"execute_id" form:"execute_id"`
  27. SceneId int `json:"scene_id" form:"scene_id"`
  28. UserName string `json:"user_name" form:"user_name"`
  29. DockerNum int `json:"docker_num" form:"docker_num"`
  30. SleepTime int `json:"sleep_time" form:"sleep_time"`
  31. }
  32. //AddReGraphTimer model for report graph timer
  33. type AddReGraphTimer struct {
  34. ScriptID int `json:"script_id" form:"script_id"`
  35. ReportSuID int `json:"report_su_id" form:"report_su_id"`
  36. JobName string `json:"job_name" form:"job_name"`
  37. BeginTime string `json:"begin_time" form:"begin_time"`
  38. Token string `json:"token" form:"token"`
  39. TestNames []string `json:"test_names" form:"test_names"`
  40. TestNameNicks []string `json:"test_name_nicks" form:"test_name_nicks"`
  41. Fusing int `json:"fusing"`
  42. FusingList []int `json:"fusing_list"`
  43. TestType int `json:"test_type"`
  44. UseBusinessStop bool `json:"use_business_stop"`
  45. BusinessStopPercent int `json:"business_stop_percent"`
  46. UseBusiStopList []bool `json:"use_busi_stop_list"`
  47. BusiStopPercentList []int `json:"busi_stop_percent_list"`
  48. }
  49. //DoPtestResp doptest response
  50. type DoPtestResp struct {
  51. BeginTime string `json:"begin_time"`
  52. JobName string `json:"job_name"`
  53. ReportSuID int `json:"report_su_id"`
  54. ScriptSnapIDs []int `json:"script_snap_ids"`
  55. ScriptID int `json:"script_id"`
  56. Message string `json:"message"`
  57. ScriptSnapID int `json:"script_snap_id"`
  58. JmeterLog string `json:"jmeter_log"`
  59. JtlLog string `json:"jtl_log"`
  60. JmxFile string `json:"jmx_file"`
  61. GroupID int `json:"group_id"`
  62. RunOrder int `json:"run_order"`
  63. LoadTime int `json:"load_time"`
  64. HostIP string `json:"host_ip"`
  65. SOS string `json:"sos"`
  66. }
  67. //AddScene add scene
  68. type AddScene struct {
  69. SceneID int `json:"scene_id" form:"scene_id"`
  70. UserName string `json:"user_name" form:"user_name"`
  71. }
  72. //TableName tablename
  73. func (r PtestJob) TableName() string {
  74. return "ptest_job"
  75. }
  76. // JobInfo Job Info
  77. type JobInfo struct {
  78. HostIp string `json:"host_ip" form:"host_ip"`
  79. JobName string `json:"job_name" form:"job_name"`
  80. }
  81. // JobInfoList Job Info List
  82. type JobInfoList struct {
  83. JobList []JobInfo `json:"job_list"`
  84. }