alibaba82
17 years agoSuper Contributor
LoadTesting / SQL / ThreadIndex question
Hello,
I am using thread strategy to run a load test. I have a file input as a datasource and my file name is specified something like C:\datafiles\{threadindex}.txt. So I have a few files in the datafile folder and depending on the threadindex, each thread picks a seperate file. This works fine but it becomes a hassle as database is dropped and I have to regenerate the files.
My question is
If I use JDBC as my datasource and my SQL Query is something like
WITH Ordered AS
(
SELECT ROW_NUMBER() OVER (ORDER BY Email) AS RowNumber, Userid, isapproved, email
FROM aspnet_Membership
) SELECT *
FROM Ordered
WHERE RowNumber between 1 and 100
which will give me the first 100 records. Is is possible to do some sort of a conditional SQL where the range of Rows is dependent on the ThreadIndex
so that if ThreadIndex = 2 I want my SQL Query to be
WITH Ordered AS
(
SELECT ROW_NUMBER() OVER (ORDER BY Email) AS RowNumber, Userid, isapproved, email
FROM aspnet_Membership
) SELECT *
FROM Ordered
WHERE RowNumber between 200 and 300
That or maybe some groovy script that creates the needed datafiles from the database so that the file content is always current.
Thanks
I am using thread strategy to run a load test. I have a file input as a datasource and my file name is specified something like C:\datafiles\{threadindex}.txt. So I have a few files in the datafile folder and depending on the threadindex, each thread picks a seperate file. This works fine but it becomes a hassle as database is dropped and I have to regenerate the files.
My question is
If I use JDBC as my datasource and my SQL Query is something like
WITH Ordered AS
(
SELECT ROW_NUMBER() OVER (ORDER BY Email) AS RowNumber, Userid, isapproved, email
FROM aspnet_Membership
) SELECT *
FROM Ordered
WHERE RowNumber between 1 and 100
which will give me the first 100 records. Is is possible to do some sort of a conditional SQL where the range of Rows is dependent on the ThreadIndex
so that if ThreadIndex = 2 I want my SQL Query to be
WITH Ordered AS
(
SELECT ROW_NUMBER() OVER (ORDER BY Email) AS RowNumber, Userid, isapproved, email
FROM aspnet_Membership
) SELECT *
FROM Ordered
WHERE RowNumber between 200 and 300
That or maybe some groovy script that creates the needed datafiles from the database so that the file content is always current.
Thanks