Skip to content

Latest commit

 

History

History
41 lines (31 loc) · 1.7 KB

README.md

File metadata and controls

41 lines (31 loc) · 1.7 KB

MiniProfiler.OpenSearch

*** 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.

Build status Nuget

image

Usage

You have two options on how to start profiling your OpenSearch requests.

Option 1. Register in services collection

In your Startup.cs, call AddOpenSearch():

public void ConfigureServices(IServiceCollection services)
{
    services.AddMiniProfiler(options => {
        options.ExcludeOpenSearchAssemblies();
    })
    .AddOpenSearch();
}

Option 2. Create profiled client manually

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);
});

Sample

See Sample.OpenSearch.Core for working example.