probe-geometry-and-industry.sh 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. #!/usr/bin/env bash
  2. # 票 67 —— 只读探针(2):geometry 端点是否收 district;industry 入参在各端点是否真的生效。
  3. set -u
  4. BASE='http://192.168.110.96:8301/api/cockpit/v1'
  5. OUT='.scratch/cockpit-real-data-wayfinding/verify/artifacts/t67'
  6. mkdir -p "$OUT"
  7. START=$(date -u -d '-7 days' +%Y-%m-%dT%H:%M:%SZ)
  8. END=$(date -u +%Y-%m-%dT%H:%M:%SZ)
  9. W="&range=LAST_7_DAYS&startTime=$START&endTime=$END"
  10. p() {
  11. local name="$1" path="$2" variant="$3"
  12. local q=''
  13. if [ $# -ge 4 ]; then q="$4"; fi
  14. local sep='?'
  15. case "$path" in *'?'*) sep='&' ;; esac
  16. local url="$BASE$path"
  17. if [ -n "$q" ]; then url="$url$sep$q"; fi
  18. local body="$OUT/geo-$name-$variant.json"
  19. local code
  20. code=$(curl -s --max-time 90 -o "$body" -w '%{http_code}' "$url")
  21. local size
  22. size=$(wc -c < "$body" | tr -d ' ')
  23. printf '%-24s %-5s %-4s %s\n' "$name" "$variant" "$code" "$size"
  24. }
  25. echo '--- geometry(管线/构件几何)对 district 的反应 ---'
  26. p geometry none ""
  27. p geometry d0 "district=0"
  28. p geometry d99 "district=99"
  29. echo
  30. echo '--- industry 是否真的生效(GAS vs DRAINAGE vs 非法) ---'
  31. p map-snapshot "/map-snapshot?page=1&pageSize=500" none ""
  32. p map-snapshot "/map-snapshot?page=1&pageSize=500" gas "industry=GAS"
  33. p map-snapshot "/map-snapshot?page=1&pageSize=500" drn "industry=DRAINAGE"
  34. p map-snapshot "/map-snapshot?page=1&pageSize=500" bad "industry=NOT_A_REAL_INDUSTRY"
  35. echo
  36. p infra-base-archives "/infrastructure/base-archives" none ""
  37. p infra-base-archives "/infrastructure/base-archives" gas "industry=GAS"
  38. p infra-base-archives "/infrastructure/base-archives" drn "industry=DRAINAGE"
  39. p infra-base-archives "/infrastructure/base-archives" bad "industry=NOT_A_REAL_INDUSTRY"
  40. echo
  41. p infra-operating "/infrastructure/operating-information" none ""
  42. p infra-operating "/infrastructure/operating-information" gas "industry=GAS"
  43. p infra-operating "/infrastructure/operating-information" drn "industry=DRAINAGE"
  44. p infra-operating "/infrastructure/operating-information" bad "industry=NOT_A_REAL_INDUSTRY"
  45. echo
  46. p infra-management "/infrastructure/management-information" none ""
  47. p infra-management "/infrastructure/management-information" gas "industry=GAS"
  48. p infra-management "/infrastructure/management-information" drn "industry=DRAINAGE"
  49. p infra-management "/infrastructure/management-information" bad "industry=NOT_A_REAL_INDUSTRY"
  50. echo
  51. p infra-emergency "/infrastructure/emergency-support" none ""
  52. p infra-emergency "/infrastructure/emergency-support" gas "industry=GAS"
  53. p infra-emergency "/infrastructure/emergency-support" drn "industry=DRAINAGE"
  54. p infra-emergency "/infrastructure/emergency-support" bad "industry=NOT_A_REAL_INDUSTRY"
  55. echo
  56. p mon-overview "/monitoring/overview" none ""
  57. p mon-overview "/monitoring/overview" gas "industry=GAS"
  58. p mon-overview "/monitoring/overview" drn "industry=DRAINAGE"
  59. p mon-overview "/monitoring/overview" bad "industry=NOT_A_REAL_INDUSTRY"
  60. echo
  61. p mon-distribution "/monitoring/distribution?page=1&pageSize=10" none ""
  62. p mon-distribution "/monitoring/distribution?page=1&pageSize=10" gas "industry=GAS"
  63. p mon-distribution "/monitoring/distribution?page=1&pageSize=10" drn "industry=DRAINAGE"
  64. p mon-distribution "/monitoring/distribution?page=1&pageSize=10" bad "industry=NOT_A_REAL_INDUSTRY"
  65. echo
  66. p mon-situation "/monitoring/situation?page=1&pageSize=10" none ""
  67. p mon-situation "/monitoring/situation?page=1&pageSize=10" gas "industry=GAS"
  68. p mon-situation "/monitoring/situation?page=1&pageSize=10" drn "industry=DRAINAGE"
  69. p mon-situation "/monitoring/situation?page=1&pageSize=10" bad "industry=NOT_A_REAL_INDUSTRY"
  70. echo
  71. p ev-current "/events/current?mode=WARNING&page=1&pageSize=10" none ""
  72. p ev-current "/events/current?mode=WARNING&page=1&pageSize=10" gas "industry=GAS"
  73. p ev-current "/events/current?mode=WARNING&page=1&pageSize=10" drn "industry=DRAINAGE"
  74. p ev-current "/events/current?mode=WARNING&page=1&pageSize=10" bad "industry=NOT_A_REAL_INDUSTRY"
  75. echo
  76. p ev-history "/events/history-analysis?eventFamily=WARNING$W&page=1&pageSize=10" none ""
  77. p ev-history "/events/history-analysis?eventFamily=WARNING$W&page=1&pageSize=10" gas "industry=GAS"
  78. p ev-history "/events/history-analysis?eventFamily=WARNING$W&page=1&pageSize=10" drn "industry=DRAINAGE"
  79. p ev-history "/events/history-analysis?eventFamily=WARNING$W&page=1&pageSize=10" bad "industry=NOT_A_REAL_INDUSTRY"
  80. echo
  81. p ev-efficiency "/events/handling-efficiency?eventFamily=WARNING$W" none ""
  82. p ev-efficiency "/events/handling-efficiency?eventFamily=WARNING$W" gas "industry=GAS"
  83. p ev-efficiency "/events/handling-efficiency?eventFamily=WARNING$W" drn "industry=DRAINAGE"
  84. p ev-efficiency "/events/handling-efficiency?eventFamily=WARNING$W" bad "industry=NOT_A_REAL_INDUSTRY"
  85. echo
  86. p ev-analysis "/events/multidimensional-analysis?eventFamily=WARNING$W" none ""
  87. p ev-analysis "/events/multidimensional-analysis?eventFamily=WARNING$W" gas "industry=GAS"
  88. p ev-analysis "/events/multidimensional-analysis?eventFamily=WARNING$W" drn "industry=DRAINAGE"
  89. p ev-analysis "/events/multidimensional-analysis?eventFamily=WARNING$W" bad "industry=NOT_A_REAL_INDUSTRY"
  90. echo
  91. p ov-monitoring "/overview/monitoring" none ""
  92. p ov-monitoring "/overview/monitoring" gas "industry=GAS"
  93. p ov-monitoring "/overview/monitoring" drn "industry=DRAINAGE"
  94. p ov-monitoring "/overview/monitoring" bad "industry=NOT_A_REAL_INDUSTRY"
  95. echo
  96. p ov-warning-settings "/overview/warning-settings?range=LAST_7_DAYS" none ""
  97. p ov-warning-settings "/overview/warning-settings?range=LAST_7_DAYS" gas "industry=GAS"
  98. p ov-warning-settings "/overview/warning-settings?range=LAST_7_DAYS" drn "industry=DRAINAGE"
  99. p ov-warning-settings "/overview/warning-settings?range=LAST_7_DAYS" bad "industry=NOT_A_REAL_INDUSTRY"
  100. echo
  101. p work-orders "/work-orders?page=1&pageSize=5" none ""
  102. p work-orders "/work-orders?page=1&pageSize=5" gas "industry=GAS"
  103. p work-orders "/work-orders?page=1&pageSize=5" drn "industry=DRAINAGE"
  104. p work-orders "/work-orders?page=1&pageSize=5" bad "industry=NOT_A_REAL_INDUSTRY"