abstracta / jmeter-dotnet-dsl Goto Github PK
View Code? Open in Web Editor NEWSimple JMeter performance tests .Net API
Home Page: https://abstracta.github.io/jmeter-dotnet-dsl/
License: Apache License 2.0
Simple JMeter performance tests .Net API
Home Page: https://abstracta.github.io/jmeter-dotnet-dsl/
License: Apache License 2.0
Code:
var stats = TestPlan(
ThreadGroup(noOfThreads, noOfIterations,
HttpSampler(uri).Method(method)
)
).Run();
System.InvalidOperationException: 'The Process object must have the UseShellExecute property set to false in order to redirect IO streams.'
Message:
Test method RestApiTestProject.RestApiTest.TestApiPerformance threw exception:
System.InvalidOperationException: The Process object must have the UseShellExecute property set to false in order to redirect IO streams.
Stack Trace:
Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
Process.Start()
BridgeService.StartJvmProcess(String jvmArgs)
BridgeService.RunBridgeCommand(String command, Object testElement, String args)
BridgeService.RunTestPlanInEngine(DslTestPlan testPlan, IDslJmeterEngine engine)
BaseJmeterEngine`1.Run(DslTestPlan testPlan)
DslTestPlan.Run()
Hello Team
I have a substantial scenarios where I need to execute multiple POST, GET, and PUT requests. I've observed that in JMeter Java-based, we can assert both the response and JSON response.
Please below sample tests
`
private const string BaseUrl = "https://your-api.com";
[Test]
public void ClientCredentialsFlowLoadTests()
{
var stats = TestPlan(
CsvDataSet("users.csv"),
HttpCookies().Disable(),
HttpCache().Disable(),
ThreadGroup(3, 10,
HttpSampler("Client Credentials Flow", BaseUrl)
.Method(HttpMethod.Post.Method)
.ContentType(new System.Net.Http.Headers.MediaTypeHeaderValue(MediaTypeNames.Application.FormUrlEncoded))
.Param("grant_type", "client_credentials")
.Param("client_id", "${clientId}")
.Param("client_secret", "${clientSecret}")
.Param("scope", "${scope}")
).Children(
RegexExtractor("ACCESS_TOKEN", "accessToken=(.*)")
),
ResponseFileSaver(DateTime.Now.ToString("dd-MM-yyyy HH:mm:ss").Replace(":", "-") + "-response")
).Run();
Assert.That(stats.Overall.SampleTimePercentile99, Is.LessThan(TimeSpan.FromSeconds(20)));
}
`
Within my code, I aim to:
Hello!
I have a project and the base workflow starts when a SignalR method is called.
How can I connect to SignalR or Socket?
Looks like this is not supported in dotnet version yet?
I test it jmeter-dotnet-dsl on local development success, but deploy on server failed, I have set the JAVA_HOME,any other should be set?
Do We Have Perfmon Plugin available for JMeter dotnet dsl and Also Do we have a way in which we can update the JMeter Properties in jmeter dsl dotnet?
Hello
I have a big model (generating using Bogus lib - it has unique email, id etc) - I want to run Post Requests to create a lot of entities. Are there any ways to implement this?
I'v found you advised to use PreProcessor here - abstracta/jmeter-java-dsl#7 - but there is no PreProcessor class in dotnet dsl.
Tnanks!
Hi Team, awesome work you are doing here.
I have a request for an implementation of the Backend Listener function to send metrics to my InfluxDB (org.apache.jmeter.visualizers.backend.influxdb.HttpMetricsSender).
Cheers
Enrico
Setting name for HttpSampler("name","url") is not being picked up. All the requests are being recorded under label "Https request". In azure load test , the only sampler name displayed is "Http Request"
You have the same feature in jmeter-java-dsl - forLoopController - https://abstracta.github.io/jmeter-java-dsl/guide/#iterating-a-fixed-number-of-times.
Is it possible to add the same feature to jmeter-dotnet-dsl ?
Thanks a lot.
When using CSV data which then contains JSON data and with a different type of delimiter (specifying \n or other types as a delimter) the JMeter DSL runner fails to run and reads the data as
HeaderValue
[{ "keyValue1" : "dataValue1"}]
[{ "keyValue2" : "dataValue2"}]
[{ "keyValue3" : "dataValue3"}]
Url to pass values into:
https://fakeurl.com/testing/
Body: ${HeaderValue}
------ Current behaviour -----
Url: https://fakeurl.com/testing/
Body: '< EOF >'
----Expected behaviour----
Url: https://fakeurl.com/testing/
Body: [{ "keyValue1" : "dataValue1"}]
Url: https://fakeurl.com/testing/
Body: [{ "keyValue2" : "dataValue2"}]
etc....
Option is avaliable in Jmeter. Please see screenshot below.
Please add the "Allow quoted data?" flag to the .Net configuration.
Love the library and the simplification for .Net yet with this feature missing it makes it very difficult to post preconfigured JSON test data to an endpoint. Other alternatives is having a "fixed" JSON payload in the body section, which does work, yet you loose the dynamic data insertion for a steadyload and rampup of changing datra for a given endpoint that may be configured to take multiple JSON inputs.
I encountered a problem, it occasionally happens that Perc99
is smaller than Perc95
and Perc90
. How is this possible and why does it happen?
Here is serialized StatsSummary
object with threads and iterations info:
{
"Threads": 100,
"Iterations": 100,
"FirstTime": "2023-12-07T17:35:01.284Z",
"EndTime": "2023-12-07T17:36:21.07Z",
"Samples": { "Total": 10000, "PerSecond": 125.33527185220464 },
"SampleTime": {
"Min": "00:00:00.0430000",
"Max": "00:00:05.8470000",
"Mean": "00:00:00.7750000",
"Median": "00:00:00.8580000",
"Perc90": "00:00:02.4550000",
"Perc95": "00:00:02.7660000",
"Perc99": "00:00:01.6390000"
},
"ErrorsCount": 0,
"SampleTimePercentile99": "00:00:01.6390000",
"ReceivedBytes": { "Total": 3770000, "PerSecond": 47251.39748828115 },
"SentBytes": { "Total": 4890000, "PerSecond": 61288.94793572807 }
}
The test assertion has configuration for errors and 95% percentile yet it seems to be missing the other configuration option such as:
See screenshot from JMeter
Could you please add in the "Average" configuration?
Thank you for the amazing work.
Is it possible to enable users to generate HTML reports from test plan execution, as in the Jmeter Java DSL?
https://abstracta.github.io/jmeter-java-dsl/guide/#generate-html-reports-from-test-plan-execution
Hello, I have simple load test like this:
[Fact]
public void Ping10Times()
{
var configuration = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
.AddJsonFile("appsettings.json")
.AddUserSecrets<LfraileNetTests>()
.AddEnvironmentVariables()
.Build();
var stats = TestPlan(
CsvDataSet("urls.csv")
.SharedIn(Abstracta.JmeterDsl.Core.Configs.DslCsvDataSet.Sharing.Thread),
ThreadGroup(1, 10,
HttpSampler("https://www.lfraile.net/${url}")
),
JtlWriter("jtls")
)
.RunIn(
new AzureEngine(
tenantId: configuration["LoadTesting:TenantId"],
clientId: configuration["LoadTesting:ClientId"],
clientSecret: configuration["LoadTesting:ClientSecret"])
.TestName("lfloadtestsdemo")
.SubscriptionId(configuration["LoadTesting:SubscriptionId"])
.TestResourceName(configuration["LoadTesting:TestResourceName"])
.ResourceGroupName(configuration["LoadTesting:TestResourceGroup"])
.Engines(1)
.TestTimeout(TimeSpan.FromMinutes(5)));
Assert.True(stats.Overall.Errors.Total == 0);
Assert.True(stats.Overall.SampleTimePercentile99 < TimeSpan.FromSeconds(5));
}
And the "urls.csv":
url
2019/03/03/environment-variables-and-azure-pipelines/
2019/03/09/opinion-what-and-why-yaml-azure-pipelines/
2019/03/30/some-ideas-on-feature-flags/
And when I try to run it, locally or even for example with GitHub Actions, I always get this error:
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.5.7+8f2703126a (64-bit .NET 8.0.2)
[xUnit.net 00:00:00.05] Starting: PoC.LoadTest.Dsl
[xUnit.net 00:00:02.16] PoC.LoadTest.Dsl.LfraileNetTests.Ping10Times [FAIL]
[xUnit.net 00:00:02.16] Abstracta.JmeterDsl.Core.Bridge.JvmException : JVM execution failed. Check stderr and stdout for additional info.
[xUnit.net 00:00:02.16] Stack Trace:
[xUnit.net 00:00:02.16] at Abstracta.JmeterDsl.Core.Bridge.BridgeService.WaitJvmProcessExit(Process process)
[xUnit.net 00:00:02.16] at Abstracta.JmeterDsl.Core.Bridge.BridgeService.RunBridgeCommand(String command, Object testElement, String args)
[xUnit.net 00:00:02.16] at Abstracta.JmeterDsl.Core.Bridge.BridgeService.RunTestPlanInEngine(DslTestPlan testPlan, IDslJmeterEngine engine)
[xUnit.net 00:00:02.16] at Abstracta.JmeterDsl.Core.Engines.BaseJmeterEngine`1.Run(DslTestPlan testPlan)
[xUnit.net 00:00:02.16] at Abstracta.JmeterDsl.Core.DslTestPlan.RunIn(IDslJmeterEngine engine)
[xUnit.net 00:00:02.16] C:\ws\lfraileorg\jmeter-dsl-net\PoC.LoadTest.Dsl\LfraileNetTests.cs(18,0): at PoC.LoadTest.Dsl.LfraileNetTests.Ping10Times()
[xUnit.net 00:00:02.16] at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
[xUnit.net 00:00:02.16] at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
[xUnit.net 00:00:02.17] Finished: PoC.LoadTest.Dsl
If I run the test without Azure Load Testing involved (Just a simple .Run()
) it works perfectly, or if I try tu run the test in Azure Load Testing but without the CSV file.
Is this supported?, Thank you!
The threadgroup method seems to have the Loopcount property missing from the configuration. There is number of threads and Ramp up yet no way to optionally set Loop count
See url from JMeter as ref
Please could this be added as an optional param?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.