我需要添加到此代码中以使10%的http请求也单击页面上的特定#link。我正在进行网站转换测试。
var http = require('http');
http.createServer(function() { }).listen(8124); // Prevent process shutting down
var requestNo = 1;
var maxRequests = 1000;
function requestTest() {
http.request({ host: 'www.mywebsite.com', method: 'GET' }, function(res) {
console.log('Completed ' + (requestNo++));
if (requestNo <= maxRequests) {
requestTest();
}
}).end();
}
requestTest();