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

MiniProfiler.Elasticsearch

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
100

Supply Chain Security

100

Vulnerability

89

Quality

100

Maintenance

100

License

Uses eval

Supply chain risk

Package uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.

Found 1 instance in 1 package

Version published
Maintainers
1
Created

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.

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