Sha256: 4b0c9f60cc18267d8085fa5780db82f83d593e53db39bd16d341d458c67284ac

Contents?: true

Size: 868 Bytes

Versions: 33

Compression:

Stored size: 868 Bytes

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.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.publish('timeline', codec.encode({ foo: payload }));
	++sent;
	if (!pub.should_buffer) {
		process.nextTick(exec);
	}
}

profiler.takeSnapshot('s_0');

exec();

setInterval(function() {
	profiler.takeSnapshot('s_' + sent);
	console.error('sent', sent, 'free', freemem(), 'cmdqlen', pub.command_queue.length, 'offqlen', pub.offline_queue.length);
}, 2000);

Version data entries

33 entries across 33 versions & 4 rubygems

Version Path
hooch-0.4.2 jasmine/node_modules/karma/node_modules/socket.io/node_modules/redis/benches/stress/pubsub/pub.js
hooch-0.4.1 jasmine/node_modules/karma/node_modules/socket.io/node_modules/redis/benches/stress/pubsub/pub.js
hooch-0.4.0 jasmine/node_modules/karma/node_modules/socket.io/node_modules/redis/benches/stress/pubsub/pub.js
hooch-0.3.0 jasmine/node_modules/karma/node_modules/socket.io/node_modules/redis/benches/stress/pubsub/pub.js
hooch-0.2.1 jasmine/node_modules/karma/node_modules/socket.io/node_modules/redis/benches/stress/pubsub/pub.js
hooch-0.2.0 jasmine/node_modules/karma/node_modules/socket.io/node_modules/redis/benches/stress/pubsub/pub.js
hooch-0.1.0 jasmine/node_modules/karma/node_modules/socket.io/node_modules/redis/benches/stress/pubsub/pub.js
hooch-0.0.8 jasmine/node_modules/karma/node_modules/socket.io/node_modules/redis/benches/stress/pubsub/pub.js
hooch-0.0.7 jasmine/node_modules/karma/node_modules/socket.io/node_modules/redis/benches/stress/pubsub/pub.js
hooch-0.0.6 jasmine/node_modules/karma/node_modules/socket.io/node_modules/redis/benches/stress/pubsub/pub.js
entangled-0.0.16 spec/dummy/public/node_modules/karma/node_modules/socket.io/node_modules/redis/benches/stress/pubsub/pub.js
entangled-0.0.15 spec/dummy/public/node_modules/karma/node_modules/socket.io/node_modules/redis/benches/stress/pubsub/pub.js
entangled-0.0.14 spec/dummy/public/node_modules/karma/node_modules/socket.io/node_modules/redis/benches/stress/pubsub/pub.js
entangled-0.0.13 spec/dummy/public/node_modules/karma/node_modules/socket.io/node_modules/redis/benches/stress/pubsub/pub.js
entangled-0.0.12 spec/dummy/public/node_modules/karma/node_modules/socket.io/node_modules/redis/benches/stress/pubsub/pub.js
entangled-0.0.11 spec/dummy/public/node_modules/karma/node_modules/socket.io/node_modules/redis/benches/stress/pubsub/pub.js
entangled-0.0.10 spec/dummy/public/node_modules/karma/node_modules/socket.io/node_modules/redis/benches/stress/pubsub/pub.js
express_translate-1.0.13 node_modules/redis/benches/stress/pubsub/pub.js
express_translate-1.0.12 node_modules/redis/benches/stress/pubsub/pub.js
express_translate-1.0.11 node_modules/redis/benches/stress/pubsub/pub.js