How to run locust from command line without disabling locust web UI - performance

How to run locust from command line without disabling locust web UI?
As per the locust documentation
To start tests directly, without using the web interface, use --headless.
ref : https://docs.locust.io/en/stable/quickstart.html?#more-options
But this would disable the web UI. How to start tests directly but also keep the web UI ?

Start locust by using cmd locust or locust -f <locustfilename.py>
To trigger the test using cmd and also keep the locust web UI I found the below workaround .
Trigger the test using the /swarm url
curl -X POST http://localhost:8089/swarm -H 'content-type: application/x-www-form-urlencoded; charset=UTF-8' -d 'user_count='10'&spawn_rate='1'&host='http://localhost:8080'
To end, use /stop url
curl http://localhost:8089/stop
It will be easy to build a script with the above curls to trigger /swarm the test, then sleep for a period of time (run duration) and then stop the test using /stop.
This way the locust web UI will also be available unlike the --headless mode.

Related

JMeter gives me bad request once I run the thread

it seems to be jmeter doesn't see the parameter required even I wrote them. I tried a lot of versions and still the samee. It works fine using postman (curl)
Most probably it's not JMeter who "gives" you bad request, it's the system under test tells you that request is malformed via HTTP Status Code 400
There is only one version which will "work" but we cannot tell you which one unless you're willing to share the "working" request details from curl and/or postman.
If you can run the request successfully using curl or Postman you can:
Create a test plan from Curl command
Record curl command execution via JMeter's HTTP(S) Test Script Recorder by running your curl request via JMeter's proxy:
curl -k -x http://localhost:8888 your-request-parameters http://your-server-endpoint
Record Postman request execution via JMeter's HTTP(S) Test Script Recorder

Nightwatch starts selenium and then hangs indefinitely

I'm running a simple nightwatch test on a Windows 10.1 machine. The tests starts up selenium server (e.g., selenium server... started - PID: 12784), but it never gets to the test code. I can use a browser to get to the localhost server page that is spawned from the "node nightwatch.js -t test.js" command, so I know the server is working properly. I've also tried running nightwatch with different browsers, e.g., -e chrome, firefox, IE, and phantomjs, and none of them work. Putting --verbose on the command doesn't provide any more console spew, so not sure how to debug this. I'm running with selenium-server-standalone v2.53.0.
Any suggestions?
Solved my own problem. Turns out the problem was with incompatible versions of node, nightwatch, and python. I figured it out by creating a totally separate clone of my repository and reinstalling all the node/nightwatch/selenium dependencies. Would be nice if there was a debug feature that could be enabled to indicate more details about where a node or nightwatch application is during application startup. I learned of node-inspector, so I'll check it out as a possible debug tool.

Chronos "Force Run" via API

On Chronos WebUI, I can "Force Run" jobs and immediately get results.
Is it possible to perform "Force Run" via Chronos REST API?
Thank you.
Jobs can be manually triggered with a PUT to /scheduler/job/$JOB_NAME. For example:
curl -L -X PUT chronos-node:8080/scheduler/job/$JOB_NAME
See https://github.com/mesos/chronos#manually-starting-a-job.

Kill a framework in Mesos

I have a Mesos cluster and was running a Spark shell connected to it. I shut down the client, but Mesos still believes the framework should be active.
I am trying to have Mesos drop the framework by using DELETE with curl
(https://issues.apache.org/jira/browse/MESOS-1390)
but I am getting no response from the server. Also, I am not sure how exactly to connect to the master: I have a multi-master setup managed by ZooKeeper, and I was trying to connect just to the active master:
curl -X DELETE http://<active master url>:5050/framworks/<framework id>
Can anyone verify if the above is the correct request?
I am using mesos-0.20.0.
Thanks
There is a restfull option calling by post the url http://your_mesos:5050/master/teardown passing frameworkId parameter
curl -d#/tmp/post.txt -X POST http://your_mesos:5050/master/teardown
/tmp/post.txt is a file with the follow content:
frameworkId=23423-23423-234234-234234
I know is late but for future askers
EDIT: The endpoint is now called teardown.
Example (thanks #Jeff): curl -X POST http://your_mesos:5050/master/teardown -d 'frameworkId=23423-23423-234234-234234'
Just to keep this up to date: The master endpoint was renamed to teardown i.e. http://localhost:5050/master/teardown is the new way to go.
TEARDOWN Request (JSON):
POST /master/teardown HTTP/1.1
Host: masterhost:5050
Content-Type: application/json
frameworkId=12220-3440-12532-2345
TEARDOWN Response:
HTTP/1.1 200 Ok
Riffing on #montells work, a one-liner would be
echo "frameworkId= 23423-23423-234234-234234" | curl -d#- -X POST http://localhost:5050/master/shutdown
Even though that JIRA issue mentions DELETE (in comments) it's not how framework shutdown is implemented. You need to do a POST request to /shutdown endpoint.
Examples: https://github.com/apache/mesos/blob/master/src/tests/teardown_tests.cpp
Regarding why the spark framework is not removed after you shutdown the client, I'm guessing it is because spark uses a high failover timeout? Nonetheless, I'm surprised that Mesos UI shows it as active instead of inactive.
Add this in your .bashrc:
#Mesos
killtask(){ curl -XPOST http://mesos_url:5050/master/teardown -d 'frameworkId='$#''; } ;
Sample usage:
killtask 123

how to run jmeter test in non gui mode when i have planned the test on gui

I have planned a test on Jmeter in GUI mode which I want to run on the linux based server. And the Jmeter on the server is in non-GUI mode, so how do i alter the jmx of my test plan so that it start executing on non-GUI mode? I tried executing it like I did on cmd of the PC where I built the test i.e "JMeter -n -t Text.jmx". But it is not executing as the test plan is made in the GUI mode.
Basically problem in jmx is this:
"HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="crw" enabled="true""
So how do I replace this to run in non-GUI mode.
Any help is appreciated :)
There is nothing to change to switch from gui to non-gui mode.
what is your error ?
This command line should work:
<JMETER_HOME>/bin/jmeter -t <Path to Test Plan> -n -l <path to results>/results.csv

Resources