|
|
@@ -266,7 +266,9 @@ with open(_metrics_path, 'w', encoding='utf-8') as _mf:
|
|
|
f"TOTAL={total}\nOK_COUNT={ok}\nNON_JSON_COUNT={non_json}\n"
|
|
|
f"SERVER_ERR_COUNT={server_err}\nCONN_ERR_COUNT={conn_err}\n"
|
|
|
f"HTTP_502_COUNT={http_502}\nINVALID={1 if INVALID else 0}\n"
|
|
|
- f"INVALID_REASON={'|'.join(reasons)}\n")
|
|
|
+ # 必须加引号:reason 含 "(90%)" 括号与 "|",不加引号被 . 源引时会报
|
|
|
+ # "syntax error near unexpected token `('" 并使 INVALID_REASON 为空
|
|
|
+ f"INVALID_REASON=\"{'|'.join(reasons)}\"\n")
|
|
|
|
|
|
print(report)
|
|
|
print(f"\n[趋势] 已写入 {trend}")
|