*** This project has been forked from https://github.com/romansp/MiniProfiler.Elasticsearch and compiled against OpenSearch ***
Put your OpenSearch.Net and OpencSearch.Client requests timings directly into MiniProfiler.
You have two options on how to start profiling your OpenSearch requests.
In your Startup.cs
, call AddOpenSearch()
:
public void ConfigureServices(IServiceCollection services)
{
services.AddMiniProfiler(options => {
options.ExcludeOpenSearchAssemblies();
})
.AddOpenSearch();
}
Update usages of OpenSearchClient
or OpenSearchLowLevelClient
with their respected profiled version ProfiledOpenSearchClient
or ProfiledOpenSearchLowLevelClient
.
services.AddSingleton<IOpenSearchClient>(x =>
{
var node = new Uri("http://localhost:9200");
var connectionSettings = new ConnectionSettings(node).DefaultIndex("opensearch-sample");
return new ProfiledOpenSearchClient(connectionSettings);
});
See Sample.OpenSearch.Core for working example.