Class ElasticsearchPerformanceDiagnostics
- Namespace
- Excalibur.Data.ElasticSearch.Monitoring
- Assembly
- Excalibur.Data.ElasticSearch.dll
Provides performance diagnostics and slow operation detection for Elasticsearch operations.
public sealed class ElasticsearchPerformanceDiagnostics
- Inheritance
-
ElasticsearchPerformanceDiagnostics
- Inherited Members
Remarks
Initializes a new instance of the ElasticsearchPerformanceDiagnostics class.
Constructors
ElasticsearchPerformanceDiagnostics(ILogger<ElasticsearchPerformanceDiagnostics>, IOptions<ElasticsearchMonitoringOptions>)
Provides performance diagnostics and slow operation detection for Elasticsearch operations.
public ElasticsearchPerformanceDiagnostics(ILogger<ElasticsearchPerformanceDiagnostics> logger, IOptions<ElasticsearchMonitoringOptions> options)
Parameters
loggerILogger<ElasticsearchPerformanceDiagnostics>The logger for performance diagnostics.
optionsIOptions<ElasticsearchMonitoringOptions>The monitoring configuration options.
Remarks
Initializes a new instance of the ElasticsearchPerformanceDiagnostics class.
Methods
GetPerformanceMetrics()
Gets the current performance metrics for all operations.
public IReadOnlyDictionary<string, ElasticsearchPerformanceDiagnostics.PerformanceMetrics> GetPerformanceMetrics()
Returns
- IReadOnlyDictionary<string, ElasticsearchPerformanceDiagnostics.PerformanceMetrics>
A dictionary of operation types and their performance metrics.
ResetMetrics()
Resets the performance metrics for all operations.
public void ResetMetrics()
StartOperation(string, string?)
Starts performance monitoring for an operation.
public ElasticsearchPerformanceDiagnostics.PerformanceContext StartOperation(string operationType, string? indexName = null)
Parameters
operationTypestringThe type of operation being monitored.
indexNamestringThe name of the index being operated on.
Returns
- ElasticsearchPerformanceDiagnostics.PerformanceContext
A performance context for tracking the operation.