[英]K6: How to Count error Bad Handshake (Websocket)
尝试使用 try catch 方法,效果很好!!
try {
// your ws.connect
// check for example
} catch(e) {
// here you can count it ... by for example increasing a Counter
// https://k6.io/docs/javascript-api/k6-metrics/counter
}
// this code will get executed regardless if there was an exception
// so you might want to do `throw e` in the catch if you don't want that
参考: https ://community.k6.io/t/how-to-count-bad-handshake-websocket/1038
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.