-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
74 changed files
with
181 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using NBomber.CSharp; | ||
using NBomber.Http; | ||
using NBomber.Http.CSharp; | ||
using NBomber.Plugins.Network.Ping; | ||
|
||
namespace Demo.Cluster.AutoCluster; | ||
|
||
public class AutoClusterExample | ||
{ | ||
public void Run() | ||
{ | ||
using var httpClient = new HttpClient(); | ||
|
||
var scenario = Scenario.Create("http_scenario", async context => | ||
{ | ||
var request = | ||
Http.CreateRequest("GET", "https://nbomber.com") | ||
.WithHeader("Content-Type", "application/json"); | ||
// .WithBody(new StringContent("{ some JSON }", Encoding.UTF8, "application/json")); | ||
|
||
var response = await Http.Send(httpClient, request); | ||
|
||
return response; | ||
}) | ||
.WithoutWarmUp() | ||
.WithLoadSimulations(Simulation.Inject(rate: 10, interval: TimeSpan.FromSeconds(1), during: TimeSpan.FromSeconds(30))); | ||
|
||
NBomberRunner | ||
.RegisterScenarios(scenario) | ||
.WithWorkerPlugins( | ||
new PingPlugin(PingPluginConfig.CreateDefault("nbomber.com")), | ||
new HttpMetricsPlugin(new [] { HttpVersion.Version1 }) | ||
) | ||
.LoadConfig("Cluster/AutoCluster/autocluster-config.json") | ||
.EnableLocalDevCluster(true) | ||
.Run(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
## AutoCluster Example | ||
|
||
In this example we will run 2 NBomber instances (nodes) in the cluster mode. | ||
|
||
- http_scenario will be executed on Coordinator | ||
- http_scenario will be executed on Agent | ||
|
||
You can take a look at `autocluster-config.json` config to check the ClusterSettings. | ||
|
||
In order to run that demo you should spin-up NATS message broker via docker-compose CLI (there is `docker-compose.yaml`) | ||
|
||
``` | ||
docker compose up | ||
``` | ||
|
||
After this you need start 2 instances of NBomber. | ||
|
||
Useful links: | ||
- [Cluster overview](https://nbomber.com/docs/cluster/overview) | ||
- [How to run cluster](https://nbomber.com/docs/cluster/run-cluster) | ||
- [AutoCluster](https://nbomber.com/docs/cluster/auto-cluster) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"TestSuite": "my test suite", | ||
"TestName": "my test", | ||
|
||
"ClusterSettings": { | ||
|
||
"AutoCluster": { | ||
"ClusterId": "test_cluster", | ||
"NATSServerURL": "nats://localhost", | ||
|
||
"Coordinator": { | ||
"TargetScenarios": ["http_scenario"] | ||
}, | ||
|
||
"Agent": { | ||
"TargetScenarios": ["http_scenario"], | ||
"AgentsCount": 1 | ||
} | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
version: "3.4" | ||
services: | ||
|
||
nats: | ||
image: "nats:2.9.6" | ||
command: --js | ||
ports: | ||
- "8222:8222" | ||
- "4222:4222" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
examples/CSharpProd/DB/LiteDB/User.cs → examples/Demo/DB/LiteDB/User.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
namespace CSharpProd.DB.LiteDB | ||
namespace Demo.DB.LiteDB | ||
{ | ||
public enum Gender | ||
{ | ||
|
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
examples/CSharpProd/DB/Redis/RedisExample.cs → examples/Demo/DB/Redis/RedisExample.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
using NBomber.CSharp; | ||
|
||
namespace CSharpProd.DB.Redis; | ||
namespace Demo.DB.Redis; | ||
|
||
public class RedisExample | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
examples/CSharpProd/DB/SQLiteDB/User.cs → examples/Demo/DB/SQLiteDB/User.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
namespace CSharpProd.DB.SQLiteDB | ||
namespace Demo.DB.SQLiteDB | ||
{ | ||
public enum Gender | ||
{ | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...rpProd/Features/CliArgs/CliArgsExample.cs → ...s/Demo/Features/CliArgs/CliArgsExample.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...asticsearchLogger/ElasticsearchExample.cs → ...asticsearchLogger/ElasticsearchExample.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.