Skip to content

Add Nbomber example using MongoDB#903

Open
sanirr wants to merge 1 commit intodevfrom
352-implement-nbomber-mongodb-example
Open

Add Nbomber example using MongoDB#903
sanirr wants to merge 1 commit intodevfrom
352-implement-nbomber-mongodb-example

Conversation

@sanirr
Copy link
Collaborator

@sanirr sanirr commented Oct 27, 2025

No description provided.

@sanirr sanirr requested a review from AntyaDev October 27, 2025 14:17
@sanirr sanirr linked an issue Oct 27, 2025 that may be closed by this pull request
public string ConnectionString { get; set; }
public int DataSize { get; set; }
public int UsersCount { get; set; }
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add enter

.WithInit(async context =>
{
var config = context.GlobalCustomSettings.Get<MongoDBConfig>();

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove empty line

var config = context.GlobalCustomSettings.Get<MongoDBConfig>();

var client = new MongoClient(config.ConnectionString);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove empty line


var user = (await _users.FindAsync(x => x.Id == id)).FirstOrDefault();

if (user != null)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return user != null
? Response.Ok(sizeBytes: user.Data.Length);
: Response.Fail();

.WithInit(context =>
{
_config = context.GlobalCustomSettings.Get<MongoDBConfig>();

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove empty lines

.WithInit(context =>
{
_config = context.GlobalCustomSettings.Get<MongoDBConfig>();

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove empty lines


namespace Demo.DB.MongoDB
{
public class MongoDBWriteScenario
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MongoWriteScenario


namespace Demo.DB.MongoDB
{
public class MongoDBReadScenario
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MongoReadScenario

public int DataSize { get; set; }
public int UsersCount { get; set; }
}
public class MongoDBInitScenario
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MongoInitScenario

}
else
{
return Response.Fail();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Response.Fail(statusCode: "not_found")

@sanirr sanirr force-pushed the 352-implement-nbomber-mongodb-example branch 3 times, most recently from 2b855b8 to 475e0eb Compare October 28, 2025 13:54
@sanirr sanirr force-pushed the 352-implement-nbomber-mongodb-example branch from 475e0eb to 2c31c67 Compare October 28, 2025 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement NBomber MongoDb example

2 participants