I have a simple java code integrated with Apache Camel which also uses camel-kafka component for logging messages in kafka topics. I have created a class which handles single request.
Using threads I can create various threads to invoke above class method to log messages.
Currently I need to load test this JAR using a tool. I want to know a tool that have very low learning curve.
Load test:
increasing users to allow multiple messages to be logged concurrently
variation of messages to increase/decrease message size
Time taken by specific users to log specific messages.
I have gone through
JMeter (learning curve is big)
JProfiler (it does not load test but monitors the application if I am
not wrong)
Netbeans Load generator (again it uses JMeter)
Download groovy-all-*.jar and drop it to /lib folder of your JMeter installation
Restart JMeter
Add Thread Group to test plan. Set desired amount of virtual users, interations and/or duration.
Add JSR223 Sampler as a child of the thread group
Choose "groovy" in the "language" dropdown
Put your "simple java code" in JSR223 Sampler's "Script" area
Save test plan.
Run it.
Was that so hard?
Related
Introduction :
I work on a tool called Jedox. In this tool there is an ETL. This ETL can run job(job allow to execute multiple step from the ETL, by step I mean a set of operation on a table(most of the time)). Some jobs can just launch successively different step from etl, but there is another type of job than can run script. I try to run a job that use Groovy language. This language is very similar to Java, the two language share many similarity.
Context :
During the run, the ETL show message logs on a console. I can also print some message myself. Ex LOG.info("hello") will print Hello in the ETL Jedox Console. LOG is an object from the class ETLLogger. It's a specific class from Jedox library.
Question :
With this logger, how can I get messages logs printed during the
job's run ?
With another Logger(from log4j for example) is it possible to get
ALL logs message printed during a process ?
Goal :
I want those logs messages to print all the warnings happened during the job at the END of the job, because jedox console is very glitchy and I can't retrieve decent data from a simple copy and paste. Furthermore, if a just copy/paste all logs I had select only warning message manually. And if it's possible I want to write the logs that interest me in a file, it would be great !
Bonus :
Here's a visual of Jedox ETL Console.
The Jedox ETL - Integrator comes with an own API, where the logger is an additional class.
If you are working with the Groovy Job envrionment, than you have full access to all of the Classes and Methods. In your case the State Class would be helpful to get all Wanrnings or Errors of your current job/subjob. You can write the state items them to a seperate File or collect them into a Varialbe for further useage, as a example. The target can be a file, database or even a jedox olap cube.
Starting Point of the Groovy Scripting API:
https://knowledgebase.jedox.com/integration/integrator-scripting-api.htm
Here is API Documentation of all Jedox ETL Classes:
https://software.jedox.com/doc/2022_2/jedox_integrator_scripting_api_doc_2022_2/com/jedox/etl/components/scriptapi/package-summary.html
How do I store all those logs in a file ?
In Jedox you can create a new File-Load, which can be triggered by the 'main' groovy job.
A good point to start is here:
https://knowledgebase.jedox.com/integration/loads/file-load.htm
I am using Jenkins pipeline to run the tests in parallel, the problem appears when the tests are sent to ReportPortal, they are all in separate launches, what i am trying to do is to set the launch name (the launch number to be precise) for tests manually so they would all be in one launch.
I have looked here for answers but only found some for NUnit and TestNG (which doesn't help me since i am having separate instances of the program). I am using Java main class to run each test in the pipeline, i read that i can set the launch name as an environment variable. Sadly i couldn't find any information how the implementation of it looks like. My question is, is it even possible to set the launch name without TestNG, if it is possible with environment variable how should i use the variable in the runner method to enforce the launch name?
java -Dmaven.clean.skip=true -Dbrowser=firefox -Dos=linux -jar -Drun.tags=#CreateEntity target/standalone/web-tests.jar
This is my setup for each test (the run tag changes obviously), the glue for cucumber and plugin for the reportportal are in the runner method.
TestNG is not mandatory for it. Here you can find JVM-based integration configs https://reportportal.io/docs/JVM-based-clients-configuration
Which means, that if you use CucumberJVM (which has jUnit under the hood), you can use any related parameter.
To specify the name of launch, you can set it in reportportal.properties file or via the command line, as -Drp.launch=zzz
But it will not resolve the issue for multi-threads. In order to have all parallel threads reported into 1 launch, you can make it in 2 ways:
Share launchID across threads. Which means that you can start launch at ReportPortal (as a part of you test runner or as a Jenkins pre-step + cUrl request). Receive launchID and share it with other threads/runners. Runners will use this id to post data, instead of creation of new launch for each thread. At the end make post-step to finish the launch.
Merge launches via UI or API. Once all executions completed, you can merge them via UI. OR you can collect launchIDs during parallel sessions, and after all execution completion, just run API call to merge launches.
Than is relevant for ReportPortal v1-v4.
For the version 5+ of ReportPortal we plan to minimize this effort via Re-Run feature. https://github.com/reportportal/reportportal/issues/363
Test runners will share launchID by default via file on local storage. And if any other parallel thread will start in this environment, then launchID will be used for reporting automatically.
It still do not affect the case, if you have parallel executions, started in parallel mode at multiply VMs, but we will try to address this case as well.
Below is my requirement :
(1)I need to do UI performance testing .
(2)At the end of the test I want jmx file to be generated,I do have the batch file that will convert it to jtl and then to html report.
Answers not known :
(1)I did browse through a lot of links that explained how to execute webdriver code using JUnit in JMeter. However I don't want to do that[run webdriver code in JMeter] and want my code to be a standalone code using HTMLUnit(headless browser) performing authentication and then the remaining click actions[Click on multiple links] ....Behind the scenes jmeter should record performance of every page and at end of test ,dump the results.Also it should be irrespective of testng /junit .Does anyone know if this is possible and can redirect me to the appropriate link.Thanks!
JMeter has nothing in common with the UI performance testing, as per JMeter main page:
JMeter is not a browser, it works at protocol level. As far as web-services and remote services are concerned, JMeter looks like a browser (or rather, multiple browsers); however JMeter does not perform all the actions supported by browsers. In particular, JMeter does not execute the Javascript found in HTML pages. Nor does it render the HTML pages as a browser does (it's possible to view the response as HTML etc., but the timings are not included in any samples, and only one sample in one thread is ever displayed at a time).
Both JUnit and TestNG automatically record function execution duration, you can build your test in such a way that measurable actions would be annotated with #Test annotation so the time will be automatically recorded.
In addition you can consider using Navigation Timing API from your WebDriver tests in order to get more information regarding page loading events.
If you still want to run JMeter tests from Java code - check out Five Ways To Launch a JMeter Test without Using the JMeter GUI article, it covers both running existing .jmx file and creating a new JMeter test purely using JMeter API from Java, however it is not applicable for your use case. The recommended way is to:
Create the main load using JMeter
Measure client-side performance using Selenium
We are developing a Wicket Application where users can log in and perform searches on a Lucene index. They can also modify their own, small index.
We have great test coverage for single-user scenarios. However, as the application is intended to be run on a server and have multiple, concurrent users, I would like to be able to set-up a test that covers this scenario (e.g. 1 application, 10 concurrent users).
I have some experience using jmeter, but I would prefer a WicketTester-style approach if possible.
Does anyone have expercience setting up such a test? Or good pointers?
We also use Wicket but concurrent users is not my main focus (no end-users). Sometimes I need to check cookie-behaviour, session-management etc. and then I use SAHI which also exists as open source IMO and as a demo. We use the Pro version also in other projects. From my perspective easy to learn and to handle.
_navigateTo("http://myapp/login.html");
// login as first user
...
// launch a new browser instance
var $instanceId = _launchNewBrowser("http://myapp/login.html");
_wait(5000);
// wait and select the new browser instance using the instanceId
_selectBrowser($instanceId);
// log in as second user
// send a chat message to first user
...
// Select the base window
_selectBrowser();
// view chat window and verify second user's chat message has arrived
...
Taken from documentation
I'm afraid it won't be possible to do what you need with WicketTester.
It starts one instance of the application. This is fine!
But it also acts like a browser, i.e. a single client.
I have used http://databene.org/contiperf for some perf tests (non-Wicket) before and I liked it. But if you try to use it with WicketTester then you either will have to have a separate WicketTester for each user or you will face synchronization issues in WicketTester itself.
I'd recommend you to use JMeter or Gatling. A user from the community made this integration: https://github.com/vanillasource/wicket-gatling. I haven't used it yet but I hope to try it soon.
I'm using offline profiling in JProfiler (in a remote machine) and I was trying to export the graphs from the snapshot using the jpexport command. However, from some reason, I can't get the ones from my custom probes, even if when I use the JProfiler GUI to open the snapshot, I have access to those graphs.
Note that I'm collecting data through the Profiling API, using Java classes which implements the 'TelemetryProbe', for example. In the documentation, there is also the possiblity of using the Custom Probe Wizard, and I wonder if I have to do by this method to get what I want, after exporting the session files to the profiling machine.
For the jpexport, I tried to export the graphs from 'ProbeTelemetry', following the instructions for the custom probes, giving the ID 1 to get my first probe, with no success. I even tried 0, but still, it returned saying there was no probe with such ID.
Still, I repeat, when uploading the snapshot with the GUI, the graphs are there, so JProfiler is collecting the information, I just can't figure out how to access it.
Any suggestions? Thank you.
As probe names for the export, use
-probeid=1
where n is the 1-based index of the custom probe.