我正在使用nodejs的NodeLoad模块同时发送多个请求来测试服务器节点应用程序,但是如果我使用numUsers : 50,它对我来说是完美的。当我接受numUsers : 300而不是给我错误,比如:TypeError: Object #<Client> has no method 'destroy'
NodeLoad应用程序I
timeLimit: 10,
targetRps: 5,
numUsers : 300,错误:
},reconnect=function(){var oldclient=client;if(oldclient){oldclient.destroy();
^
TypeError: Object #<Client> has no method 'destroy'
at reconnect (/root/nodeLoadDemo/nodeload/node_modules/nodeload/nodeload.js:9:506)
at Client.<anonymous> (/root/nodeLoadDemo/nodeload/node_modules/nodeload/nodeload.js:10:180)
at Client.EventEmitter.emit (events.js:117:20)
at ClientRequest.<anonymous> (http.js:2144:10)
at ClientRequest.EventEmitter.emit (events.js:95:17)
at Socket.socketOnEnd [as onend] (http.js:1568:9)
at Socket.g (events.js:180:16)
at Socket.EventEmitter.emit (events.js:117:20)
at _stream_readable.js:919:16
at process._tickCallback (node.js:419:13)有谁能解释一下错误的原因吗?以及解决这些错误的方法?
谢谢你。
发布于 2015-10-15 05:10:27
我得到了答案
您只需要在node modules中进行更改。在句尾打开nodeload模块和nodeload.js文件检查行9,replace
if (oldclient) { oldclient.destroy(); }
到
if (oldclient && oldclient.destroy) { oldclient.destroy(); }
https://stackoverflow.com/questions/29554044
复制相似问题