Sha256: c23c1257e3c82299bd4df08b6206227559cef22f09dc4e28ac2a0b8e0a18a03a

Contents?: true

Size: 1.05 KB

Versions: 33

Compression:

Stored size: 1.05 KB

Contents

'use strict';

var freemem = require('os').freemem;
//var profiler = require('v8-profiler');
var codec = require('../codec');

var sent = 0;

var pub = require('redis').createClient(null, null, {
	//command_queue_high_water: 5,
	//command_queue_low_water: 1
})
.on('ready', function() {
	this.del('timeline');
	this.emit('drain');
})
.on('drain', function() {
	process.nextTick(exec);
});

var payload = '1'; for (var i = 0; i < 12; ++i) payload += payload;
console.log('Message payload length', payload.length);

function exec() {
	pub.rpush('timeline', codec.encode({ foo: payload }));
	++sent;
	if (!pub.should_buffer) {
		process.nextTick(exec);
	}
}

//profiler.takeSnapshot('s_0');

exec();

setInterval(function() {
	//var ss = profiler.takeSnapshot('s_' + sent);
	//console.error(ss.stringify());
	pub.llen('timeline', function(err, result) {
		console.error('sent', sent, 'free', freemem(),
			'cmdqlen', pub.command_queue.length, 'offqlen', pub.offline_queue.length,
			'llen', result
		);
	});
}, 2000);

/*setTimeout(function() {
	process.exit();
}, 30000);*/

Version data entries

33 entries across 33 versions & 4 rubygems

Version Path
express_translate-1.0.10 node_modules/redis/benches/stress/rpushblpop/pub.js
express_translate-1.0.9 node_modules/redis/benches/stress/rpushblpop/pub.js
express_translate-1.0.8 node_modules/redis/benches/stress/rpushblpop/pub.js
express_translate-1.0.7 node_modules/redis/benches/stress/rpushblpop/pub.js
express_translate-1.0.6 node_modules/redis/benches/stress/rpushblpop/pub.js
express_translate-1.0.5 node_modules/redis/benches/stress/rpushblpop/pub.js
express_translate-1.0.4 node_modules/redis/benches/stress/rpushblpop/pub.js
express_translate-1.0.3 node_modules/redis/benches/stress/rpushblpop/pub.js
express_translate-1.0.2 node_modules/redis/benches/stress/rpushblpop/pub.js
express_translate-1.0.1 node_modules/redis/benches/stress/rpushblpop/pub.js
express_translate-1.0 node_modules/redis/benches/stress/rpushblpop/pub.js
express_translate-1.0.0.0 node_modules/redis/benches/stress/rpushblpop/pub.js
iron_worker_ng-0.10.1 iron_worker_examples/binary/phantom-nodejs/node_modules/phantom/node_modules/dnode/node_modules/socket.io/node_modules/redis/tests/stress/rpushblpop/pub.js