I want to test one feature, and I need open connection to send some JSONs in it (from server to JMeter) from time to time, but I'm new to JMeter and can't get how to do it.
So, two steps I need help with:
How to keep connection open?
How to get data from JSON and trigger some action? (just couple of requests in my case)
Thank you in advance.
So, seems like there's no standart solution for this, but you can create your own implementation of TCPSampler or override TCPClientImpl and use it in TCPClient classname
Related
I am currently redirecting the socket io through a custom proxy. The server it actually gets send to changes from time to time. The "new" server is notfied that a client will connect/swap to it before it connects/swaps. The only issue is that this leads to the client timing out and reconnecting, which works, but takes 2 seconds that I dont want to client to wait on switch. I do not want the client to know that the server change so somehow i have to make the server to add the upcomming client/socket id to its internal list.
How could I achieve this?
Ive looked at the socket.io-adapter, but I wasn't sure if that is only for rooms/or if there is an easier way to do it
It appears using the adapter would fix it. Rather than adding my own I just ended up accessing the default namespace and doing a 'addAll' to add the client.
io.nsps["/"].adapter.addAll(socketId, new Set<Room>([socketId]));
I have a bunch of server logs with api requests I'd like to replicate for testing. Is there an easy way to "export" those logs {uri: $path, query: $queryparams} as input for blazemeter to test?
Jmeter is open source. Just modify the source to replay the logs and to handle the user input and dynamic components. Every time you see a new source IP, fork a new thread. Use the delays between requests to define the think time. And you will have created "Web replay," the equivalent of Oracle's DB Replay
There might be a chance that JMeter's Access Log Sampler will work for you if your server is in: Tomcat, Resin, Weblogic, and SunOne.
If it's not you might need to convert the log to the supported format or implement your own versions of LogParser and Generator
More information: The JMeter Access Log Sampler - A Guide
From what I have found and tested, you can use the WebSocket Sampler for Apache JMeter, however you cannot record your test requests because the WebSocket request will not be passed appropriately through and back from the Java Proxy Server.
So, what are my options? I can build every request by hand instead of recording - and keep using JMeter -very tedious.
Build a new WebSocket Sampler?
Build onto the Java Proxy Server?
Or use something besides JMeter?
Before I dive into another deep pit, a little good advice would be much appreciated! Thank you so much!
I need to write web aplication like google reader (using SmartGWT).
Instead of RSS feads I will show log files which updates in realtime. I think I can start a timer and ask server are there any new logs every minute. Is this the right way to do this?
Do I have to use WebSockets? Are they working in all the modern browsers?
I think I can start a timer and ask server are there any new logs every minute. Is this the right way to do this?
Without using server push this is the way to go. You typically want to query the server with the timestamp of the last received log entry. This way can you only send the diff since the last pull.
See here for some more information on GWT and push (which is actually pull). Or check out stream-hub (and the pimped stock watcher example) if you wanna go for server push.
This is intended to be a lightweight generic solution, although the problem is currently with a IIS CGI application that needs to log the timeline of events (second resolution) for troubleshooting a situation where a later request ends up in the MySQL database BEFORE the earlier request!
So it boils down to a logging debug statements in a single text file.
I could write a service that manages a queue as suggested in this thread:
Issue writing to single file in Web service in .NET
but deploying the service on each machine is a pain
or I could use a global mutex, but this would require each instance to open and close the file for each write
or I could use a database which would handle this for me, but it doesnt make sense to use a database like MySQL to try to trouble shoot a timeline issue with itself. SQLite is another possability, but this thread
http://www.perlmonks.org/?node_id=672403
Suggests that it is not a good choice either.
I am really looking for a simple approach, something as blunt as writing to individual files for each process and consolidating them accasionally with a scheduled app. I do not want to over engineer this, nor spend a week implementing it. It is only needed occassionally.
Suggestions?
Try the simplest solution first - each write to the log opens and closes the file. If you experience problems with this, which you probably won't , look for another solution.
You can use file locking. Lock the file for writing, write the message, unlock.
My suggestion is to preserve performance then think in asynchronous logging. Why not send your data log info using UDP to service listening port and he write to log file.
I would also suggest some kind of a central logger that can be called by each process in an asynchronous way. If the communication is UDP or RPC or whatever would be an implementation detail.
Even thought it's an old post, has anyone got an idea why not using the following concept:
Creating/opening a file with share mode of FILE_SHARE_WRITE.
Having a named global mutex, and opening it.
Whenever a file write is desired, lock the mutex first, then write to the file.
Any input?