Skip to content

Commit

Permalink
Comment fixups.
Browse files Browse the repository at this point in the history
  • Loading branch information
n1mmy committed Nov 6, 2013
1 parent 6a78254 commit 8bf8162
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions examples/unfinished/benchmark/benchmark.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
// Pick which scenario we run. Pass the 'SCENARIO' environment variable
// to change this. See 'benchmark-scenarios.js' for the list of
// scenarios.

var PARAMS = {};
// Pick scenario from settings.
// XXX settings now has public. could move stuff there and avoid this.
var PARAMS = {};
if (Meteor.isServer) {
if (!Meteor.settings.params)
throw new Error("Must set scenario with Meteor.settings");
Expand All @@ -12,9 +10,10 @@ if (Meteor.isServer) {
PARAMS = __meteor_runtime_config__.PARAMS;
}


// id for this client or server.
var processId = Random.id();
console.log("SSS", processId);
console.log("processId", processId);


//////////////////////////////
Expand Down Expand Up @@ -63,22 +62,14 @@ _.times(PARAMS.numCollections, function (n) {


if (Meteor.isServer) {
// init
Meteor.startup(function () {
// clear all the collections.
_.each(Collections, function (C) {
// XXX no, don't remove!
// C.remove({});
});
});

// periodic db check. client list
// periodic db check. generate a client list.
var currentClients = [];
var totalDocs = 0;
Meteor.setInterval(function () {
var newClients = {};
var newTotal = 0;
// XXX explain 3
// XXX hardcoded time
var since = +(new Date) - 1000*PARAMS.insertsPerSecond * 5;
_.each(Collections, function (C) {
_.each(C.find({when: {$gt: since}}, {fields: {fromProcess: 1, when: 1}}).fetch(), function (d) {
Expand Down

0 comments on commit 8bf8162

Please sign in to comment.