JMeter - Performance Testing - Third Party Backend GET Response - performance

I am currently working on load testing an application, where the users can create orders. Once the order is created, the request reaches the Middleware which triggers a scheduler. From the scheduler, the GET Status reaches a 3rd Party API and the Response is stored at the Backend (DB). The GET Status response can only be seen on the Backend and it will not be visible to the User Interface. Please help on How to record this GET Status Response at the Backend using latest version of Jmeter.

You can use JDBC Request sampler for reading information from the database
Download JDBC Driver for the database you're using and drop it to JMeter Classpath
Restart JMeter to pick up the driver
Add JDBC Connection Configuration element and specify database URL, credentials and thread pool name
In the JDBC Request sampler set the same thread pool name as in the point 3 and create an SQL Select query to fetch the response from the database. If you will need the response later on it can be stored into a JMeter Variable

Related

Jmeter JDBC request sampler not making UPDATEs

I am using Jmeter 5 to run a simple SQL UPDTAE statement using JDBC Request sampler. After running the query ([Screenshot: JDBC Request][2])I can see in the result tree window it says "1 updates" ([Screenshot: View Result Tree][1]), but when I check within the database I dont see the specific field is getting updated.
It doesn't seem to be a connection issue. When I run the same query from Management Studio the field is getting updated fine. Am I missing some settings in Jmeter?
You need to set true in Auto Commit of JDBC Connection Configuration
Turn auto commit on or off for the connections.

Nifi Processor to run multiple instance

I have a use case where we are using NiFi to extract data from multiple sources. The database information for DbcpConnectionPool and ExecuteSQL processor are updated by NiFi rest api in the processor when user select the table from the custom UI. Now the issue is suppose we have triggered Oracle extraction for a particular database and at the same time some other user logs in and trigger Oracle process for some other database. Now the rest call are sent using processors ID. Since there is only one flow for oracle the second call will stop the first flow.
Is there anyway to fix this? Like dynamically create the dbcpConnection processor or processGroup for each request.
Attaching the current flow.
The ListenHttp calls contains the table Name to be fetched. Before the ListenHttp call is made a rest call is made to update the dbcpConnectionPool with URL and details and also update the ExecuteSql Processor with necessary processor. Now if in between one request being served another request comes up how to handle that.

Can not load JDBC driver. in

Test Plan.
Add one Thread Group with default settings.
Add JDBC Connection Configuration with below setting.
Add JDBC Requset for Simple select stement.
Add Constant Timer with 5000 miliseconds Thread Delay.
Add View Results Tree.
My DBServer Name : proddbtest1.xyz.com
SQL Instance Name: Prodbtest1\LIVE
I fill up this parameter value in DB URL and Driver class. In fact I download latest JDBC sqljdbc42.jar from Net and past at Lib folder.
After running my test plan still I get an error message
"java.sql.SQLException: Cannot load JDBC driver class
com.microsoft.jdbc.sqlserver.SQLServerDriver"
Can any one help me where I am passing wrong configuration settings.
As per Using the JDBC Driver article the correct Microsoft JDBC Driver class name is:
com.microsoft.sqlserver.jdbc.SQLServerDriver
you are trying to use the following one:
com.microsoft.jdbc.sqlserver.SQLServerDriver
^^^^^^^^^^^^^^
So replace jdbc and sqlserver and your setup will work.
Also don't forget to restart JMeter to pick the sqljdbc42.jar up.
Just in case see The Real Secret to Building a Database Test Plan With JMeter article to learn more about database load testing using JMeter

Passing ClientInfo/ClientIdentifier on syscontext/connection with Hibernate for audit purposes

I have a web service which processes inserts/updated data to DB. When client calls this webservice, UserId(currently logged in user to portal) will be sent in Request. I need to pass this userId to Db connection or set it in sys context for Audit purpose. we have existing audit tables and triggers to inserts/updates to Audit table after insert/update on actual table. So to track these changes I need to pass this UserId somehow to connection so that it can be retrieved from DB from Sys Context or $session and inserts in Audit table. I am currently using Spring and Hibernate transactions to process data with DB.
I tried to Set client info on Connection but it's not working. I tried below:
Session session=sessionFactory.getCurrentSession();
SessionImpl sImpl=(SessionImpl) session;
Connection connection=sImpl.connection();
connection.setClientInfo("ClientUser", "ABC");
And also I am trying to set client info by calling Stored procedure DBMS_APPLICATION_INFO.SET_CLIENT_INFO before performing operation on DB every time from application code.but I am not sue if it's a correct way to handle it.
I am trying it with both OCI and thin JDBC drivers but not able find a way to set this user id.
Can someone let me know if there is any efficient way to pass user id on sys context or with Connection. I am currently using hibernate4, Spring, Websphere Server, Oracle DB.
I am using Spring #Transactional to handle hibernate Connections and transactions to perform operation on DB.Connections are from Connection pool and I am using org.springframework.jndi.JndiObjectFactoryBean for dataSource.
is there any way to have interceptor or wrapper around connection to set it when we get the connection from connection pool.
Has anyone done this before?
This is described in spring data JDBC Extensions for the Oracle Database
Chapter
8.2 Configuration of a Custom DataSource Connection Preparer
...but you could implement a ConnectionPreparer that would use the current users login id. That way you can capture user login information even if your data source is configured with a shared user name.
This is a solution for oracle, which I think you are using. It should be also possible to adapt that to another database.

Jmeter and database

I'd like to know the mechanism of performance testing Database by Jmeter, so need your help on my concern as below:
Q1. Does Jmeter will access directly to Database for testing ? Or,
it will access to database via a website having database URL (as the Database URL on JDBC request config) ?
Q2. which fields will be tested in Database : capacity or Database structure or others ? - please explain in advantage.
Besides, Jmeter is a good tool for testing database ? - which cases / why should we use ?
Thanks,
Q1: JMeter has JDBC Request sampler which can connect to database directly assuming appropriate JDBC driver in JMeter classpath and proper JDBC Connection Configuration
Q2: It's totally up to you as JMeter doesn't test anything. If you specify a query or a set of queries under Transaction Controller JMeter will report the time which queries took under the load and errors if any.

Resources