Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Release v0.5.2b2

  • Loading branch information...
commit bec27727f1e2717b40cd095057a4cde7c24a18e3 1 parent a931b42
@pgte authored
View
2  benchmarks/results/summaries/latest
View
38 lib/alfred/files/file.js
@@ -121,13 +121,22 @@ File.prototype.write = function(string, callback) {
this.rawWrite(string, pos, callback);
};
+File.prototype.enqueue = function() {
+ this.queue_size ++;
+ // console.log('queue size for ' + this.file_path + ' is ' + this.queue_size);
+};
+
+File.prototype.dequeue = function() {
+ this.queue_size --;
+};
+
File.prototype.rawWrite = function(string, pos, callback) {
var str = calculateHeader(string, pos) + string + calculateTrailer(string, pos),
buffer = new Buffer(Buffer.byteLength(str) + 2), // give space for the magic char (2 bytes)
length = buffer.length,
self = this;
- this.queue_size ++;
+ this.enqueue();
buffer[0] = MAGIC_CHAR_1;
buffer[1] = MAGIC_CHAR_2;
@@ -136,12 +145,12 @@ File.prototype.rawWrite = function(string, pos, callback) {
(function tryWrite () {
fs.write(self.fd, buffer, 0, length, pos, function(err, written) {
if (err) {
- self.queue_size --;
+ self.dequeue();
callback(err);
self._needsEnd();
} else {
if (written == length) {
- self.queue_size --;
+ self.dequeue();
callback(null, pos, length);
self._needsEnd();
} else {
@@ -171,7 +180,7 @@ File.prototype.rawWrite_sync = function(string, pos) {
/* Read */
File.prototype.fetch = function(pos, length, callback) {
- this.queue_size ++;
+ this.enqueue();
var buf = new Buffer(length),
bytesRead = 0,
@@ -181,13 +190,13 @@ File.prototype.fetch = function(pos, length, callback) {
(function tryRead() {
fs.read(self.fd, buf, bytesRead, length - bytesRead, pos + bytesRead, function(err, bytesReadNow) {
if (err) {
- self.queue_size --;
+ self.dequeue();
callback(err);
self._needsEnd();
} else {
bytesRead += bytesReadNow;
if (bytesRead >= length) {
- self.queue_size --;
+ self.dequeue();
try {
record = getAndValidateRecordFromBuffer(buf.slice(0, length), pos, self);
} catch (except) {
@@ -207,7 +216,7 @@ File.prototype.fetch = function(pos, length, callback) {
File.prototype.readOne = function(position, callback) {
- this.queue_size ++;
+ this.enqueue();
var buf = new Buffer(14),
read_string = new Buffer(14);
@@ -221,7 +230,7 @@ File.prototype.readOne = function(position, callback) {
// console.log(position + bytesRead);
fs.read(self.fd, buf, 0, buf.length, position + bytesRead, function(err, bytesReadNow) {
if (err) {
- self.queue_size --;
+ self.dequeue();
callback(err);
self._needsEnd();
} else {
@@ -230,7 +239,7 @@ File.prototype.readOne = function(position, callback) {
// console.log(processed_header);
if (bytesReadNow == 0) {
- self.queue_size --;
+ self.dequeue();
self._needsEnd();
callback(null, null);
return;
@@ -243,6 +252,7 @@ File.prototype.readOne = function(position, callback) {
console.log("buf.copy(" + read_string.length + ", " + bytesRead + ", 0, " + bytesReadNow + ");");
console.log("processed_header: " + processed_header);
console.log('buf.length: ' + buf.length);
+ self.dequeue();
callback(excp);
return;
}
@@ -252,6 +262,7 @@ File.prototype.readOne = function(position, callback) {
// if we haven't been able to read the header fully, try again
if (bytesRead >= 2 && !processed_header) {
if (read_string[0] != MAGIC_CHAR_1 || read_string[1] != MAGIC_CHAR_2) {
+ self.dequeue();
callback(new AlfredCheckError('Magic char not present in header', 'MAGIC_CHAR_NOT_PRESENT'));
return;
}
@@ -272,6 +283,7 @@ File.prototype.readOne = function(position, callback) {
console.log("read_string.copy(new_buf, 0, 0, " + bytesRead + ");")
console.log(read_string.length);
console.log(new_buf.length);
+ self.dequeue();
callback(excp);
return;
}
@@ -281,7 +293,7 @@ File.prototype.readOne = function(position, callback) {
processed_header = true;
}
if (bytesRead >= length) {
- self.queue_size --;
+ self.dequeue();
record = undefined;
try {
record = getAndValidateRecordFromBuffer(read_string.slice(0, length), position, self);
@@ -333,7 +345,9 @@ File.prototype.position = function(pos) {
File.prototype._needsEnd = function() {
- if (this.ending && this.queue_size === 0) {
+ // console.log('_needsEnd 1 for path ' + this.file_path + ' with queue size = ' + this.queue_size);
+ if (this.ending && this.queue_size <= 0) {
+ // console.log('_needsEnd 2');
this._forceEnd(this.ending);
}
};
@@ -344,8 +358,10 @@ File.prototype.end = function(callback) {
}
if (this.queue_size === 0) {
+ // console.log('closing 4.1 on ' + this.file_path);
this._forceEnd(callback);
} else {
+ // console.log('closing 4.2' + this.file_path);
this.ending = callback;
}
};
View
2  lib/alfred/meta/commands/detach_key_map.js
@@ -42,7 +42,7 @@ DetachKeyMapCommand.prototype.do = function(meta, callback) {
}
callback(null);
- meta.emit('key_map_detached', key_map_name);
+ meta.emit('key_map_detached', self.key_map_name);
});
});
View
41 lib/alfred/meta/database.js
@@ -1,5 +1,5 @@
var path = require('path'),
- fs = require('fs')
+ fs = require('fs'),
util = require('util'),
Step = require('step'),
EventEmitter = require('events').EventEmitter,
@@ -13,7 +13,7 @@ var default_meta_options = {
replication_master: false,
replication_port: 5293,
replication_max_file_size_kb: 10000,
- replication_max_keep_ms: 1000 * 60 * 60 * 24 * 15, // 15 days
+ replication_max_keep_ms: 1000 * 60 * 60 * 24 * 15 // 15 days
};
var Database = function(db_path, options, callback) {
@@ -176,12 +176,15 @@ Database.prototype.load = function(callback) {
self._load_key_maps(function(err) {
if (err) { callback(err); return; }
self._load_indexes(callback);
- })
-}
+ });
+};
Database.prototype._load_key_maps = function(callback) {
var self = this;
+
this.meta.get('key_maps', function(err, value) {
+ var key_map_name;
+
if (err) { callback(err); return; }
if (value) {
var key_maps = value;
@@ -192,7 +195,7 @@ Database.prototype._load_key_maps = function(callback) {
}
}
- if (_key_maps.length == 0) {
+ if (_key_maps.length === 0) {
callback(null);
return;
}
@@ -204,7 +207,7 @@ Database.prototype._load_key_maps = function(callback) {
if (err) {
callback(err);
} else {
- executed ++
+ executed ++;
if (executed == _key_maps.length) {
callback(null);
}
@@ -217,7 +220,7 @@ Database.prototype._load_key_maps = function(callback) {
callback(null);
}
});
-}
+};
Database.prototype._load_indexes = function(callback) {
var self = this;
@@ -239,7 +242,7 @@ Database.prototype._load_indexes = function(callback) {
}
}
- if (run_indexes.length == 0) {
+ if (run_indexes.length === 0) {
callback(null);
return;
}
@@ -252,7 +255,7 @@ Database.prototype._load_indexes = function(callback) {
index_commands.push(key_map_indexes[index_name]);
}
}
- if (index_commands.length == 0) {
+ if (index_commands.length === 0) {
callback(null);
} else {
var ran_commands = 0;
@@ -274,7 +277,7 @@ Database.prototype._load_indexes = function(callback) {
callback(null);
}
});
-}
+};
Database.prototype.save_key_maps = function(callback) {
this.meta.put('key_maps', this.key_maps, callback);
@@ -285,8 +288,9 @@ Database.prototype.save_indexes = function(callback) {
};
Database.prototype.close = function(callback) {
- var self = this;
- var key_map_names = [];
+ var self = this,
+ key_map_names = [],
+ key_map_name;
if (self.state == 'closing') {
callback('Database is already closing');
@@ -314,7 +318,7 @@ Database.prototype.close = function(callback) {
}
}
- if (key_map_names.length == 0) {
+ if (key_map_names.length === 0) {
self.meta.end(callback);
return;
}
@@ -340,7 +344,8 @@ Database.prototype.close = function(callback) {
};
Database.prototype.closeSync = function() {
-
+ var key_map_name;
+
for (key_map_name in this.key_maps) {
if (this.key_maps.hasOwnProperty(key_map_name)) {
this[key_map_name].endSync();
@@ -358,12 +363,14 @@ Database.prototype.closeSync = function() {
Database.prototype.registerCommand = function(command_names, command_constructor) {
var self = this;
+
var invoke = function() {
+ var argument_index;
// last argument is a callback
var command_args = [];
for (argument_index in arguments) {
if (argument_index < (arguments.length - 1)) {
- command_args.push(arguments[argument_index])
+ command_args.push(arguments[argument_index]);
}
}
var command = command_constructor.apply(null, command_args);
@@ -436,5 +443,5 @@ Database.prototype.stopListening = function(listeners) {
/* Model */
Database.prototype.define = function(modelName, options) {
- return Model.define(this, modelName, options)
-}
+ return Model.define(this, modelName, options);
+};
View
20 lib/alfred/meta/finder.js
@@ -32,11 +32,13 @@ Finder.prototype.executeOperatorOnField = function(keys, field, operator_string,
var operator = operators[operator_string];
if (!operator) { throw new Error('could not find operator ' + operator_string); }
return operator.operateOnIndex(keys, index, value, field, this);
-}
+};
var _optimize = function(query) {
- var self = this;
- for (var field in this.query) {
+ var self = this,
+ field;
+
+ for (field in this.query) {
if (query.hasOwnProperty(field)) {
(function(field) {
var condition = query[field];
@@ -53,9 +55,9 @@ var _optimize = function(query) {
operators.sort();
var first_op = operators[0];
var second_op = operators[1];
- if ( (first_op == '$gt' || first_op == '$gte')
- && (second_op == '$lt' || second_op == '$lte')) {
- query[field] = {"$range" : [condition[first_op], condition[second_op], (first_op == '$gt'), (second_op == '$lt')]}
+ if ( (first_op == '$gt' || first_op == '$gte') &&
+ (second_op == '$lt' || second_op == '$lte')) {
+ query[field] = {"$range" : [condition[first_op], condition[second_op], (first_op == '$gt'), (second_op == '$lt')]};
}
}
@@ -88,10 +90,10 @@ Finder.prototype.executeAndJustReturnKeys = function(query) {
var condition = query[field];
keys = self.executeCondition(keys, field, condition);
})(field);
- };
+ }
}
return keys;
-}
+};
Finder.prototype.executeAllAndJustReturnKeysInOrder = function(query, order, offset, limit, callback) {
var self = this;
@@ -276,7 +278,7 @@ module.exports.create = function(key_map, query) {
chainable.setKeyMap = function(key_map) {
finder.key_map = key_map;
- }
+ };
return chainable;
};
View
4 lib/alfred/meta/finder_stream.js
@@ -45,13 +45,13 @@ FinderStream.prototype.watch = function() {
self.finder.executeAllAndJustReturnKeysInOrder(self.query, self.order, self.offset, self.limit, function(err, keys) {
if (err) {
self.emit('error', err);
- return
+ return;
}
self.keys = keys;
process.nextTick(function() {
_watch();
});
- })
+ });
} else {
if (self.keys.length > 0) {
key = self.keys.splice(0, 1)[0];
View
10 lib/alfred/meta/model/document.js
@@ -16,7 +16,7 @@ Document.prototype.isNew = function() {
Document.prototype._assureNotNew = function() {
if (this.isNew()) { throw new Error('record is not saved yet'); }
-}
+};
var newId = function() {
return (Math.floor(Math.random() * 100000000000000000) + Date.now()).toString(32);
@@ -66,7 +66,7 @@ Document.prototype.atomic = function(document_callback, saved_callback) {
Document.prototype.destroy = function(callback) {
this._assureNotNew();
- this.model.delete(this.id, callback)
+ this.model.delete(this.id, callback);
};
Document.prototype.reload = function(callback) {
@@ -105,10 +105,10 @@ Document.prototype.equal = function(obj) {
if (a.prototype !== b.prototype) {return false;}
//~~~I've managed to break Object.keys through screwy arguments passing.
// Converting to array solves the problem.
+ var ka, kb, key, i;
try {
- var ka = Object.keys(a),
- kb = Object.keys(b),
- key, i;
+ ka = Object.keys(a);
+ kb = Object.keys(b);
} catch (e) {//happens when one is a string literal and the other isn't
return false;
}
View
19 lib/alfred/meta/model/model.js
@@ -5,6 +5,7 @@ var registrar = require('./registrar'),
Finder = require('../finder'),
mixin = require('../../util/mixin'),
Document = require('./document'),
+ util = require('util'),
EventEmitter = require('events').EventEmitter;
var Model = function(database, name, options) {
@@ -85,10 +86,10 @@ Model.prototype._promiseDone = function() {
Model.prototype._promiseUndone = function() {
if (this._promiseReallyDone) {
delete this._promiseReallyDone;
- this['get'] = this['_waiting_get'];
- this['put'] = this['_waiting_put'];
- this['atomic'] = this['_waiting_atomic'];
- this['delete'] = this['_waiting_delete'];
+ this.get = this._waiting_get;
+ this.put = this._waiting_put;
+ this.atomic = this._waiting_atomic;
+ this.delete = this._waiting_delete;
}
};
@@ -119,7 +120,7 @@ Model.prototype._put = function(id, value, callback) {
self.collection.put(id, value, function(err) {
if (err) { self._error(err); return; }
callback();
- })
+ });
};
Model.prototype.put = function(id, value, callback) {
@@ -230,9 +231,9 @@ Model.prototype.find = function(query) {
};
Model.prototype.instantiate = function(doc) {
- var doc = Document.create(this, doc || {});
- doc.__proto__ = this.protoBase;
- return doc;
+ docObj = Document.create(this, doc || {});
+ docObj.__proto__ = this.protoBase;
+ return docObj;
};
Model.prototype.new = Model.prototype.instantiate;
@@ -243,7 +244,7 @@ Model.prototype.property = function(name, typeOrSchema, schema) {
switch (typeof(typeOrSchema)) {
case "string": return typeOrSchema;
case "function": return typeOrSchema.name.toLowerCase();
- case "object": schema = typeOrSchema;
+ case "object": schema = typeOrSchema; break;
case "undefined": return "string";
default: throw new(Error)("Argument Error");
}
View
2  lib/alfred/meta/model/registrar.js
@@ -9,4 +9,4 @@ module.exports.put = function(name, model) {
module.exports.get = function(name) {
return modelsByName[name];
-}
+};
View
52 lib/alfred/meta/model/schema.js
@@ -1,3 +1,25 @@
+var typeOf = function (value) {
+ var s = typeof(value);
+
+ if (Array.isArray(value)) {
+ return 'array';
+ } else if (s === 'object') {
+ if (s) { return 'object'; }
+ else { return 'null'; }
+ } else if (s === 'function') {
+ if (s instanceof RegExp) { return 'regexp'; }
+ else { return 'function'; }
+ } else {
+ return s;
+ }
+};
+
+var enforceType = function(val, type) {
+ if (typeOf(val) !== type) {
+ throw new(TypeError)({name:"ArgumentError"});
+ }
+};
+
module.exports.definers = {
all: {
define: function (attr, val /*, condition, options */) {
@@ -13,8 +35,8 @@ module.exports.definers = {
options = args[0] || {};
}
- if (options.message) { this.property.messages[attr] = options.message }
- if (options.condition) { this.property.conditions[attr] = condition }
+ if (options.message) { this.property.messages[attr] = options.message; }
+ if (options.condition) { this.property.conditions[attr] = condition; }
return this;
},
@@ -80,7 +102,7 @@ module.exports.definers = {
lazy: function (val, condition, options) {
enforceType(val, "boolean");
return this.define("lazy", val, condition, options);
- },
+ }
},
string: {
pattern: function (val, condition, options) {
@@ -99,7 +121,7 @@ module.exports.definers = {
enforceType(val, "array");
return this.define("minLength", val[0], condition, options)
.define("maxLength", val[1], condition, options);
- },
+ }
},
number: {
minimum: function (val, condition, options) {
@@ -117,25 +139,3 @@ module.exports.definers = {
}
}
};
-
-var enforceType = function(val, type) {
- if (typeOf(val) !== type) {
- throw new(TypeError)({name:"ArgumentError"});
- }
-};
-
-var typeOf = function (value) {
- var s = typeof(value);
-
- if (Array.isArray(value)) {
- return 'array';
- } else if (s === 'object') {
- if (s) { return 'object' }
- else { return 'null' }
- } else if (s === 'function') {
- if (s instanceof RegExp) { return 'regexp' }
- else { return 'function' }
- } else {
- return s;
- }
-};
View
27 lib/alfred/meta/model/validator.js
@@ -20,7 +20,7 @@ var Validator = function(object, schema) {
this._validateObject();
-}
+};
module.exports.validate = function (object, schema) {
var validator = new Validator(object, schema);
@@ -30,7 +30,7 @@ module.exports.validate = function (object, schema) {
Validator.prototype._validateObject = function () {
var self = this;
Object.keys(self.schema.properties).forEach(function (k) {
- self._validateProperty(k, self.schema.properties[k])
+ self._validateProperty(k, self.schema.properties[k]);
});
};
@@ -62,6 +62,12 @@ Validator.prototype._validateProperty = function (property, schema) {
var object = this.object;
var type, value = object[property];
+ function constrain(name, value, assert) {
+ if ((name in schema) && !assert(value, schema[name])) {
+ self.error(name, property, value, schema);
+ }
+ }
+
if (value === undefined && !schema.optional) {
this.error('optional', property, true, schema);
}
@@ -75,24 +81,19 @@ Validator.prototype._validateProperty = function (property, schema) {
constrain('validateWith', value, function(a, e) { return e(a); });
switch (schema.type || typeof(value)) {
case 'string':
- constrain('minLength', value.length, function (a, e) { return a >= e });
- constrain('maxLength', value.length, function (a, e) { return a <= e });
- constrain('pattern', value, function (a, e) { return e.test(a) });
+ constrain('minLength', value.length, function (a, e) { return a >= e; });
+ constrain('maxLength', value.length, function (a, e) { return a <= e; });
+ constrain('pattern', value, function (a, e) { return e.test(a); });
break;
case 'number':
- constrain('minimum', value, function (a, e) { return a >= e });
- constrain('maximum', value, function (a, e) { return a <= e });
- constrain('divisibleBy', value, function (a, e) { return a % e === 0 });
+ constrain('minimum', value, function (a, e) { return a >= e; });
+ constrain('maximum', value, function (a, e) { return a <= e; });
+ constrain('divisibleBy', value, function (a, e) { return a % e === 0; });
}
} else {
this.error('type', property, typeof(value), schema);
}
- function constrain(name, value, assert) {
- if ((name in schema) && !assert(value, schema[name])) {
- self.error(name, property, value, schema);
- }
- }
};
Validator.prototype.error = function(attribute, property, actual, schema) {
View
6 lib/alfred/meta/replication/commands/sync.js
@@ -21,10 +21,10 @@ var pump = function(readStream, writeStream, callback) {
readStream.addListener('data', function(chunk) {
try {
- if (writeStream.write(chunk) === false) readStream.pause();
+ if (writeStream.write(chunk) === false) { readStream.pause(); }
} catch (err) {
try { readStream.destroy(); } catch(excp) { /* do nothing */ }
- try { writeStream.emd(); } catch(excp) { /* do nothing */ }
+ try { writeStream.emd(); } catch(excp2) { /* do nothing */ }
call(err);
}
@@ -59,7 +59,7 @@ var pump = function(readStream, writeStream, callback) {
readStream.destroy();
call(err);
});
-}
+};
module.exports = function(master, args, stream) {
try {
View
14 lib/alfred/meta/replication/log_stream.js
@@ -37,8 +37,8 @@ LogStream.prototype._grabNextFile = function(callback) {
if (err) { callback(err); return; }
self.current_file = file;
self.current_file_pos = 0;
- callback(self.current_file)
- })
+ callback(self.current_file);
+ });
};
if (!file_path) {
self.logger.once('data', function() {
@@ -49,7 +49,7 @@ LogStream.prototype._grabNextFile = function(callback) {
} else {
openFilePath(file_path);
}
-}
+};
LogStream.prototype._seek = function(pos, callback) {
var self = this;
@@ -77,7 +77,7 @@ LogStream.prototype._seek = function(pos, callback) {
}
});
})();
- })
+ });
};
LogStream.prototype._read = function() {
@@ -105,7 +105,7 @@ LogStream.prototype._read = function() {
self._grabNextFile(function() {
process.nextTick(function() {
self._read();
- })
+ });
});
} else {
// if not, wait for new data
@@ -122,13 +122,13 @@ LogStream.prototype._read = function() {
LogStream.prototype.pause = function() {
this.paused = true;
-}
+};
LogStream.prototype.resume = function() {
if (!this.paused) { return; }
this.paused = false;
this._read();
-}
+};
LogStream.prototype.destroy = function() {
delete self.logger;
View
16 lib/alfred/meta/replication/logger.js
@@ -7,8 +7,8 @@ var File = require('../../files/file'),
var default_options = {
max_file_size_kb: 10000,
- max_keep_ms: 1000 * 60 * 60 * 24 * 15, // 15 days
-}
+ max_keep_ms: 1000 * 60 * 60 * 24 * 15 // 15 days
+};
var Logger = function(database, options, callback) {
var self = this;
@@ -28,7 +28,7 @@ var Logger = function(database, options, callback) {
if (err) { callback(err); return; }
callback(null, self);
});
- })
+ });
});
};
@@ -126,8 +126,8 @@ Logger.prototype._backlogKeyMap = function(key_map_name, key_map, callback) {
var send = function(what) {
self.current_log_pos ++;
- what['__log_pos'] = self.current_log_pos;
- what['__logger_id'] = self.logger_id;
+ what.__log_pos = self.current_log_pos;
+ what.__logger_id = self.logger_id;
self.backlog_file.write(JSON.stringify(what), function(err) {
if (err) { callback(err); return; }
self.emit('data', what);
@@ -183,8 +183,8 @@ Logger.prototype._startLiveLog = function(callback) {
var reallyWrite = function(what) {
self.current_log_pos ++;
- what['__log_pos'] = self.current_log_pos;
- what['__logger_id'] = self.logger_id;
+ what.__log_pos = self.current_log_pos;
+ what.__logger_id = self.logger_id;
self.livelog_file.write(JSON.stringify(what), function(err, pos, length) {
if (err) { callback(err); return; }
self.emit('data', what);
@@ -281,7 +281,7 @@ Logger.prototype.seek = function(pos) {
for(var i = 0; i < this.livelog_file_paths.length; i++) {
path = this.livelog_file_paths[i];
- match = path.match(/live_log_([0-9]+).alf$/)
+ match = path.match(/live_log_([0-9]+).alf$/);
if (!match) {
this_pos = 0;
View
6 lib/alfred/meta/replication/master.js
@@ -21,13 +21,13 @@ var options_merger = require('../../util/options_merger');
var default_options = {
port: 5293,
max_file_size_kb: 10000
-}
+};
var Master = function(database, options, callback) {
this.database = database;
this.options = options_merger.merge(default_options, options);
this._initialize(callback);
-}
+};
util.inherits(Master, EventEmitter);
@@ -67,7 +67,7 @@ Master.prototype._initializeServer = function(callback) {
});
this.server.listen(this.options.port);
callback(null);
-}
+};
Master.prototype._executeCommand = function(command, stream) {
var self = this;
View
2  package.json
@@ -1,6 +1,6 @@
{ "name" : "alfred"
, "description" : "In-process key-value store"
-, "version" : "0.5.2b1"
+, "version" : "0.5.2b2"
, "homepage" : "http://pgte.github.com/alfred"
, "author" : "Pedro Teixeira <pedro.teixeira@gmail.com> (http://metaduck.com)"
, "contributors" :
View
2  test/replication/test_master.js
@@ -124,7 +124,7 @@ module.exports.run = function(next) {
if (err) { next(err); return; }
db.users.ensureIndex('age', {ordered: true}, age_transform_function, function(err) {
if (err) { next(err); return; }
-
+
var users_in = 0;
for (var id in USERS) {
if (USERS.hasOwnProperty(id)) {
View
2  tools/benchmarks.js
@@ -26,7 +26,7 @@ var benchmark_results = [];
var do_benchmark = function() {
var benchmark = benchmarks[benchmark_index];
-
+
var module_path = path.join(__dirname, '..', 'benchmarks', benchmark + ".js");
if (!path.existsSync(module_path)) throw new Error("Could not find benchmark path "+module_path);
var run_this = [path.join(__dirname, 'benchmark.js'), benchmark];
Please sign in to comment.
Something went wrong with that request. Please try again.