I tested with different web services, here is an example.
$ hulken bitcoin_options.json
setting options from file bitcoin_options.json
number of times to repeat each request set to 10
target url set to https://blockchain.info/ticker
request file path (including file name) set to ./bitcoin_request.json
the following characters (in an url) will cause a request to be skipped :,{,}
happyTimeLimit set to 10
numberOfHulkenAgents set to 1
slowRequestsTimeLimit set to 0.5
angryOnFailedRequest set to true
chatty set to true
happyMessage set to HULKEN PLEASED, YOU MAY CONTINUE WITH YOUR DAY!
angryMessage set to HULKEN ANGRY! HULKEN SMASH!
minWaitTime set to 500
maxWaitTime set to 4000
headers set to {"Accept":"application/json, text/javascript, */*; q=0.01","Accept-Encoding":"gzip, deflate, sdch","Accept-Language":"en,de;q=0.8,en-US;q=0.6,it;q=0.4","Cache-Control":"no-cache","Connection":"keep-alive","Pragma":"no-cache","User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.45 Safari/537.36"}
..::HULKEN SMASH::..
initiating agent 1 of 1
... no login required, continuing with anonymous user
... starting to execute requests
GET ?cors=true (by agent 1/1) responded in 8.494 seconds
GET ?cors=true (by agent 1/1) responded in 7.47 seconds
GET ?cors=true (by agent 1/1) responded in 7.398 seconds
GET ?cors=true (by agent 1/1) responded in 9.561 seconds
GET ?cors=true (by agent 1/1) responded in 9.27 seconds
GET ?cors=true (by agent 1/1) responded in 8.376 seconds
GET ?cors=true (by agent 1/1) responded in 7.283 seconds
GET ?cors=true (by agent 1/1) responded in 7.397 seconds
GET ?cors=true (by agent 1/1) responded in 9.067 seconds
GET ?cors=true (by agent 1/1) responded in 11.115 seconds
.. all requests have been executed
**************** RESULT ******************
number of concurrent requests 10
number of hulken agents running 1
number of unique requests 1
number of slow requests 10
number of failed requests 0
total seconds elapsed 15.058
avg response time (in seconds) 8.5431
req/sec 0.66
random request wait time (in seconds) 0.5-4
******************************************
HULKEN ANGRY! HULKEN SMASH!
In contrast when I employ the Chrome browser API using jQuery I get an average response time of 123ms
. The browser cache is disabled and I confirmed that the 23
request in my test yielded unique api responses. The JavaScript measurement is consistent with the measured times in the Network panel of the Chrome developer tools.
Here is the simple code:
var
dT = 200,
varDT = 100;
function callingBC()
{
$.ajax("https://blockchain.info/ticker",
{
data: { cors: true },
dataType: "json"
})
.then((function(startTime)
{
return function( data, textStatus, jqXHR )
{
responseTimes.push(Date.now() - startTime);
if (!abort)
{
var waitFor = dT + Math.random() * varDT - varDT / 2;
setTimeout(callingBC, waitFor);
}
};
}(Date.now()))
, function( jqXHR, textStatus, errorThrown )
{
console.log(textStatus, errorThrown);
}
);
}