commit
13b81bc650
|
@ -51,7 +51,6 @@ const options = {
|
|||
const message = JSON.stringify(mockPageView());
|
||||
options.headers['Content-Length'] = message.length;
|
||||
options.headers['Content-Type'] = 'application/json';
|
||||
options.headers['user-agent'] = 'User-Agent: Mozilla/5.0 LoadTest';
|
||||
options.body = message;
|
||||
options.path = '/api/collect';
|
||||
const request = client(options, callback);
|
||||
|
@ -95,7 +94,6 @@ loadtest.loadTest(options, (error, results) => {
|
|||
if (results.errorCodes && Object.keys(results.errorCodes).length) {
|
||||
console.log(chalk.redBright('*'), chalk.red('Error Codes:'), results.errorCodes);
|
||||
}
|
||||
// console.log(results);
|
||||
});
|
||||
|
||||
/**
|
||||
|
@ -121,6 +119,9 @@ function mockPageView(
|
|||
|
||||
// If you pass in --verbose, this function is called
|
||||
function statusCallback(error, result, latency) {
|
||||
if (error) {
|
||||
return console.error(chalk.redBright(error));
|
||||
}
|
||||
console.log(
|
||||
chalk.yellowBright(`\n## req #${result.requestIndex + 1} of ${latency.totalRequests}`),
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue