drewww / socket.io-benchmarking Goto Github PK
View Code? Open in Web Editor NEWA framework for testing high concurrency behavior in socket.io
A framework for testing high concurrency behavior in socket.io
Hello sir, I am an jr.Android Developer and created a socket.io client side with java. So I think you know there is v1 or v2 in client side for java. My problem is that my company use v3 in server side so I have to use v2 client (highest version in java) but I cant connect to their server. So I need to a v3 or higher server side url for test my client side for check the problem is in my side or in server side. Do you know any v3 or higher server?
Note: When I switch to v1 in client I can easly connect to other v2 servers.
Hi,
I'm just trying to build your benchmark but I'm having some problems with the Java libraries. Could you tell me which version of
org.apache.commons.math
net.tootallnate.websocket.WebSocketClient
you originally worked with? Doesn't seem to be working with the latest versions.
Thanks
Edit: Sorry, it does work I was checking out the HEAD of the net.tootallnate.websocket.WebSocketClient git repo rather than the latest stable release (0.7 at the time of writing)
First of all I want to thank you for this code.
I just wondering how I can make graphs from results? There is analysis.m file in util folder. What code it is and how I can execute it? Dot m files seems to be linked with C based on google search, but I am not so familiar with C. So can you help me and give me some hits how to generate graphs easily from results?
Thank you.
My server logs:
25 Jan 16:37:26 - info: users: 102 messagesPerSecond: 0
25 Jan 16:37:27 - info: users: 102 messagesPerSecond: 0
25 Jan 16:37:28 - info: users: 102 messagesPerSecond: 0
25 Jan 16:37:29 - info: users: 102 messagesPerSecond: 0
25 Jan 16:37:30 - info: users: 102 messagesPerSecond: 0
25 Jan 16:37:31 - info: users: 102 messagesPerSecond: 0
25 Jan 16:37:32 - info: users: 102 messagesPerSecond: 0
25 Jan 16:37:33 - info: users: 102 messagesPerSecond: 0
25 Jan 16:37:34 - info: users: 102 messagesPerSecond: 0
25 Jan 16:37:35 - info: users: 102 messagesPerSecond: 0
For 100 concurrences (they dont seem to close properly but I don't mind restarting). But it doesn't appear to be sending anything. Do I need to do something on the client in order to get it to send messages?
I was just looking for a load-testing framework last night when I saw you pushed this today. Having at least a simple set of instructions on its usage would be immensely helpful. I've gotten as far as getting server.js running, but am not sure what's next to actually test this against my own websocket app.
Hi
I have run server side with following code, its can run perfectly
//////////////////////////////////Server.js ///////////////////////////////////////////////////////
var port = 8080,
app = require('express')(),
io = require('socket.io').listen(app.listen(port)),
logger = require('winston'),
program = require('commander');
logger.cli();
logger.default.transports.console.timestamp = true;
program.version('0.1')
.option('-p, --port [num]', 'Set the server port (default 8080)')
.option('-H, --disableheartbeats', 'Disable heartbeats')
.parse(process.argv)
var server = "localhost";
if(program.args.length==1) {
server = program.args[0];
} else if (program.args.length==0) {
logger.warn("Defaulting to localhost.");
}
if(program.port) {
logger.info("Setting port to " + program.port);
port = program.port;
}
if(program.disableheartbeats) {
io.set("heartbeats", false)
}
io.set("log level", 0);
app.get('/', function (req, res) {
res.sendfile(__dirname + '/index.html');
});
var connectedUsersCount = 0;
var messagesPerSecond = 0;
io.sockets.on('connection', function(socket) {
connectedUsersCount++;
socket.on('chat', function(data) {
//logger.info("chat message arrived"+data.text);
io.sockets.emit('chat', {text:data.text});
messagesPerSecond++;
});
socket.on('disconnect', function(data) {
connectedUsersCount--;
});
});
setTimeout(logStatus, 1000);
function logStatus() {
setTimeout(logStatus, 1000);
logger.info("users: " + connectedUsersCount + "\tmessagesPerSecond: " + messagesPerSecond);
messagesPerSecond = 0;
}
/////////////////////////////////////////////////////////////////////////////////////////
And also run the Client Side (Java Code) , i got this error. Can anyone help me.
---------------- CONCURRENCY 1 ----------------
Exception in thread "Thread-0" java.lang.NoClassDefFoundError: com/netiq/websocket/WebSocketClient
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.websocketbenchmark.client.SocketIOLoadTester.makeConnections(SocketIOLoadTester.java:138)
at org.websocketbenchmark.client.SocketIOLoadTester.run(SocketIOLoadTester.java:92)
Caused by: java.lang.ClassNotFoundException: com.netiq.websocket.WebSocketClient
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 14 more
Thank you very much.
Wa
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.