Skip to content

Commit

Permalink
Merge pull request #10 from cvallance/master
Browse files Browse the repository at this point in the history
  • Loading branch information
romansp committed Aug 11, 2020
2 parents 9dcb9d5 + 444953d commit e7c239c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/MiniProfiler.Elasticsearch/MiniProfilerElasticsearch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ internal static class MiniProfilerElasticsearch {
/// Handles <see cref="IApiCallDetails"/> and pushes <see cref="CustomTiming"/> to current <see cref="MiniProfiler"/> session.
/// </summary>
/// <param name="apiCallDetails"><see cref="IApiCallDetails"/> to be handled.</param>
/// <param name="profiler">Current <see cref="MiniProfiler"/> session instance.</param>
internal static void HandleResponse(IApiCallDetails apiCallDetails, MiniProfiler profiler) {
internal static void HandleResponse(IApiCallDetails apiCallDetails) {
var profiler = MiniProfiler.Current;
if (profiler == null || profiler.Head == null || apiCallDetails.DebugInformation == null) {
return;
}
Expand Down
4 changes: 1 addition & 3 deletions src/MiniProfiler.Elasticsearch/ProfiledElasticClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
/// Profiled version of <see cref="ElasticClient"/>. Handles responses and pushes data to current <see cref="MiniProfiler"/>'s session.
/// </summary>
public class ProfiledElasticClient : ElasticClient {
private readonly MiniProfiler _profiler = MiniProfiler.Current;

/// <summary>
/// Provides base <see cref="ElasticClient"/> with profiling features to current <see cref="MiniProfiler"/> session.
/// </summary>
Expand All @@ -16,7 +14,7 @@ public ProfiledElasticClient(ConnectionSettings configuration)
: base(configuration) {
ProfilerUtils.ExcludeElasticsearchAssemblies();
ProfilerUtils.ApplyConfigurationSettings(configuration);
configuration.OnRequestCompleted(apiCallDetails => MiniProfilerElasticsearch.HandleResponse(apiCallDetails, _profiler));
configuration.OnRequestCompleted(apiCallDetails => MiniProfilerElasticsearch.HandleResponse(apiCallDetails));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
/// Profiled version of <see cref="ElasticLowLevelClient"/>. Handles responses and pushes data to current <see cref="MiniProfiler"/>'s session.
/// </summary>
public class ProfiledElasticsearchClient : ElasticLowLevelClient {
private readonly MiniProfiler _profiler = MiniProfiler.Current;

/// <summary>
/// Provides base <see cref="ElasticLowLevelClient"/> with profiling features to current <see cref="MiniProfiler"/> session.
/// </summary>
Expand All @@ -16,7 +14,7 @@ public ProfiledElasticsearchClient(ConnectionConfiguration configuration)
: base(configuration) {
ProfilerUtils.ExcludeElasticsearchAssemblies();
ProfilerUtils.ApplyConfigurationSettings(configuration);
configuration.OnRequestCompleted(apiCallDetails => MiniProfilerElasticsearch.HandleResponse(apiCallDetails, _profiler));
configuration.OnRequestCompleted(apiCallDetails => MiniProfilerElasticsearch.HandleResponse(apiCallDetails));
}
}
}

0 comments on commit e7c239c

Please sign in to comment.