🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

MiniProfiler.Elasticsearch

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

MiniProfiler.Elasticsearch

Elasticsearch.Net and NEST client for logging to MiniProfiler.

7.1.0
NuGet
Version published
Maintainers
1
Created
Source

MiniProfiler.Elasticsearch

Put your Elasticsearch.Net and NEST requests timings directly into MiniProfiler.

Build status Nuget feed

profiler-popup profiler-queries

Usage

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

Option 1. Register in services collection

In your Startup.cs, call AddElastic():

public void ConfigureServices(IServiceCollection services)
{
    services.AddMiniProfiler(options => {
        options.ExcludeElasticAssemblies();
    })
    .AddElastic();
}

Option 2. Create profiled client manually

Update usages of ElasticClient or ElasticLowLevelClient with their respected profiled version ProfiledElasticClient or ProfiledElasticLowLevelClient.

services.AddSingleton<IElasticClient>(x => 
{
    var node = new Uri("http://localhost:9200");
    var connectionSettings = new ConnectionSettings(node).DefaultIndex("elasticsearch-sample");
    return new ProfiledElasticClient(connectionSettings);
});

Sample

See Sample.Elasticsearch.Core for working example.

Keywords

MiniProfiler

FAQs

Package last updated on 21 Oct 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts