summaryrefslogtreecommitdiff
path: root/tests/http/server.js
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2015-11-10 11:59:03 -0800
committerAdam Ierymenko <adam.ierymenko@gmail.com>2015-11-10 11:59:03 -0800
commit2854f14966b430e551c2ca101694f542bdaa38b9 (patch)
tree64557e1323239d2611cbfebd427f37c707dbf826 /tests/http/server.js
parent4328c6c3bc402feffc06aade0059a6632b34c087 (diff)
downloadinfinitytier-2854f14966b430e551c2ca101694f542bdaa38b9.tar.gz
infinitytier-2854f14966b430e551c2ca101694f542bdaa38b9.zip
Some cluster parameter tweaks, and change the test code in tests/http to dramatically reduce the amount of data transfer to/from the test master. Also add results of first successful 50k test.
Diffstat (limited to 'tests/http/server.js')
-rw-r--r--tests/http/server.js15
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/http/server.js b/tests/http/server.js
index 1abe624b..681f1069 100644
--- a/tests/http/server.js
+++ b/tests/http/server.js
@@ -30,12 +30,21 @@ app.post('/:agentId',function(req,res) {
var resultData = null;
try {
resultData = JSON.parse(req.rawBody);
- console.log(Date.now()+','+resultData.source+','+resultData.target+','+resultData.time+','+resultData.bytes+','+resultData.timedOut+',"'+((resultData.error) ? resultData.error : '')+'"');
+ console.log(Date.now().toString()+','+resultData.source+','+resultData.target+','+resultData.time+','+resultData.bytes+','+resultData.timedOut+',"'+((resultData.error) ? resultData.error : '')+'"');
} catch (e) {}
}
- knownAgents[agentId] = Date.now();
- return res.status(200).send(JSON.stringify(Object.keys(knownAgents)));
+ var thisUpdate = null;
+ if (!(agentId in knownAgents)) {
+ thisUpdate = Object.keys(knownAgents);
+ for(var id in knownAgents)
+ knownAgents[id].push(agentId);
+ knownAgents[agentId] = [];
+ } else {
+ thisUpdate = knownAgents[agentId];
+ knownAgents[agentId] = [];
+ }
+ return res.status(200).send(JSON.stringify(thisUpdate));
});
var expressServer = app.listen(SERVER_PORT,function () {