-
Notifications
You must be signed in to change notification settings - Fork 18
Mongo
Furkan Güngör edited this page Mar 27, 2022
·
3 revisions
Install EasyProfiler.Mongo
from Nuget Package
Initilaze EasyProfilerDbContext
in Program.cs
to save the results.
builder.Services.AddEasyProfilerDbContext(options =>
{
options.ConnectionString = "mongodb://localhost:27017";
options.Database = "{yourDatabaseName}";
}, options=>
{
options.Resulation = EasyProfiler.CronJob.Common.Resulation.HIGH;
});
and EasyProfilerInterceptor
extensions add for own MongoContext
.
public MongoContext(IServiceProvider serviceProvider)
{
var client = new MongoClient(new MongoClientSettings
{
Server = new MongoServerAddress("{yourHost}"),
ClusterConfigurator = cb =>
{
cb.Subscribe<CommandStartedEvent>(e =>
{
e.InitilazeStartedEvent(serviceProvider);
});
cb.Subscribe<CommandSucceededEvent>(e =>
{
e.InitilazeSucceededEvent(serviceProvider);
});
}
});
}
Welcome to the EasyProfiler wiki!
Topics:
-
Getting Started
-
Databases
-
Advanced Queries
-
Other