Interface IDatabaseMonitor
public interface IDatabaseMonitor
Methods
CleanAsync(CollectionInfo, bool)
Task<CleanInfo> CleanAsync(CollectionInfo collectionInfo, bool cleanGuids)
Parameters
collectionInfoCollectionInfocleanGuidsbool
Returns
CompareSchemaAsync(CollectionInfo, int, CancellationToken)
Sample up to sampleSize documents and return a three-way diff between the C# entity type's
public properties, the registered entity-type names, and the field set observed in the sample.
Top-level fields only.
Task<SchemaComparisonDto> CompareSchemaAsync(CollectionInfo collectionInfo, int sampleSize, CancellationToken cancellationToken = default)
Parameters
collectionInfoCollectionInfosampleSizeintcancellationTokenCancellationToken
Returns
DropIndexAsync(CollectionInfo)
Task<(int Before, int After)> DropIndexAsync(CollectionInfo collectionInfo)
Parameters
collectionInfoCollectionInfo
Returns
FindConnectionIdBySource(string)
Find the SignalR connection ID of a connected agent by source name. Returns null if no connected agent matches.
string FindConnectionIdBySource(string sourceName)
Parameters
sourceNamestring
Returns
GetCallCounts()
Get call counts per collection fingerprint key.
IReadOnlyDictionary<string, int> GetCallCounts()
Returns
GetCallDtos(CallType)
Get serialization-friendly representation of calls by type.
IEnumerable<CallDto> GetCallDtos(CallType callType)
Parameters
callTypeCallType
Returns
GetCallSummary()
Get call summary grouped by collection and function (for chatty/slow detection).
IEnumerable<CallSummaryDto> GetCallSummary()
Returns
GetCalls(CallType)
IEnumerable<CallInfo> GetCalls(CallType callType)
Parameters
callTypeCallType
Returns
GetCollectionSources(string)
Get the source names that have reported a given collection (by fingerprint key).
IReadOnlyCollection<string> GetCollectionSources(string fingerprintKey)
Parameters
fingerprintKeystring
Returns
GetConfigurations()
IEnumerable<ConfigurationName> GetConfigurations()
Returns
GetConnectionPoolState()
Get aggregate connection pool state.
ConnectionPoolStateDto GetConnectionPoolState()
Returns
GetDocumentAsync(CollectionInfo, string, CancellationToken)
Fetch a single raw document by id. idRaw is auto-detected as Guid → ObjectId → string.
Returns null when no document matches. Returned Json is MongoDB Extended JSON.
Task<DocumentDto> GetDocumentAsync(CollectionInfo collectionInfo, string idRaw, CancellationToken cancellationToken = default)
Parameters
collectionInfoCollectionInfoidRawstringcancellationTokenCancellationToken
Returns
GetErrorSummary()
Get error summary grouped by exception type and collection.
IEnumerable<ErrorSummaryDto> GetErrorSummary()
Returns
GetExplainAsync(Guid, CancellationToken)
Resolve the explain plan for a specific call.
Task<string> GetExplainAsync(Guid callKey, CancellationToken cancellationToken = default)
Parameters
callKeyGuidcancellationTokenCancellationToken
Returns
GetIndexBlockersAsync(CollectionInfo, string)
Task<IEnumerable<string[]>> GetIndexBlockersAsync(CollectionInfo collectionInfo, string indexName)
Parameters
collectionInfoCollectionInfoindexNamestring
Returns
- Task<IEnumerable<string[]>>
GetInstanceAsync(CollectionFingerprint)
Task<CollectionInfo> GetInstanceAsync(CollectionFingerprint fingerprint)
Parameters
fingerprintCollectionFingerprint
Returns
GetInstancesAsync(bool, string)
IAsyncEnumerable<CollectionInfo> GetInstancesAsync(bool fullDatabaseScan = false, string filter = null)
Parameters
Returns
GetMonitorClientDetail(string, int)
Atomic snapshot of everything a single agent has contributed: its
MonitorClientDto, the collections it has reported, its
most recent recentCallLimit calls, and its latest
queue state. Returns null when no agent matches
sourceName. Powers the per-agent detail dialog.
MonitorClientDetail GetMonitorClientDetail(string sourceName, int recentCallLimit = 20)
Parameters
Returns
GetMonitorClients()
Get all known monitoring agents (connected and recently disconnected).
IEnumerable<MonitorClientDto> GetMonitorClients()
Returns
GetPerSourceQueueState()
Get per-source queue state for all known sources (local + remote).
IReadOnlyDictionary<string, ConnectionPoolStateDto> GetPerSourceQueueState()
Returns
GetSlowCallsWithIndexInfoAsync()
Get slow calls with index coverage info (for missing index detection).
IAsyncEnumerable<SlowCallWithIndexInfoDto> GetSlowCallsWithIndexInfoAsync()
Returns
GetSubscriptions()
Get active subscriptions and their subscriber counts. Keys are topic names (e.g. "LiveMonitoringMarker"), values are subscriber counts.
IReadOnlyDictionary<string, int> GetSubscriptions()
Returns
IngestCall(CallDto)
Ingest an externally produced call (e.g. from a remote agent) into the monitor pipeline. The call will appear in GetCalls, summaries, and Blazor components.
void IngestCall(CallDto call)
Parameters
callCallDto
IngestClientConnected(MonitorClientDto)
Register a connected monitoring agent.
void IngestClientConnected(MonitorClientDto client)
Parameters
clientMonitorClientDto
IngestClientDisconnected(string)
Mark a monitoring agent as disconnected.
void IngestClientDisconnected(string connectionId)
Parameters
connectionIdstring
IngestCollectionInfo(RemoteCollectionInfoDto, string)
Ingest collection metadata from a remote agent.
void IngestCollectionInfo(RemoteCollectionInfoDto collectionInfo, string connectionId = null)
Parameters
collectionInfoRemoteCollectionInfoDtoconnectionIdstring
IngestQueueMetric(string, int, int, double?)
Ingest a queue metric snapshot from a remote agent.
void IngestQueueMetric(string sourceName, int queueCount, int executingCount, double? waitTimeMs)
Parameters
ListDocumentsAsync(CollectionInfo, DocumentListQuery, CancellationToken)
List up to Limit raw documents from the collection.
FilterJson and SortJson are parsed via
BsonDocument.Parse; invalid JSON throws FormatException.
Task<DocumentListDto> ListDocumentsAsync(CollectionInfo collectionInfo, DocumentListQuery query, CancellationToken cancellationToken = default)
Parameters
collectionInfoCollectionInfoqueryDocumentListQuerycancellationTokenCancellationToken
Returns
RefreshStatsAsync(CollectionFingerprint)
Task RefreshStatsAsync(CollectionFingerprint fingerprint)
Parameters
fingerprintCollectionFingerprint
Returns
ResetAsync()
Task ResetAsync()
Returns
ResetCalls()
void ResetCalls()
RestoreAllIndicesAsync(Func<CollectionInfo, bool>, IProgress<IndexAssureProgress>, CancellationToken)
Iterates every known collection (via GetInstancesAsync(bool, string)) and calls RestoreIndexAsync(CollectionInfo, bool) on each one. Use to apply newly added indexes across already-deployed environments without restarting consumer apps.
Task<IndexAssureSummary> RestoreAllIndicesAsync(Func<CollectionInfo, bool> filter = null, IProgress<IndexAssureProgress> progress = null, CancellationToken cancellationToken = default)
Parameters
filterFunc<CollectionInfo, bool>Optional predicate; collections returning false are skipped.
progressIProgress<IndexAssureProgress>Optional progress reporter — fires once per collection.
cancellationTokenCancellationTokenCancels the iteration between collections.
Returns
RestoreIndexAsync(CollectionInfo, bool)
Task RestoreIndexAsync(CollectionInfo collectionInfo, bool force)
Parameters
collectionInfoCollectionInfoforcebool
Returns
TouchAsync(CollectionInfo)
Task TouchAsync(CollectionInfo collectionInfo)
Parameters
collectionInfoCollectionInfo
Returns
Events
CollectionDroppedEvent
event EventHandler<CollectionDroppedEventArgs> CollectionDroppedEvent
Event Type
CollectionInfoChangedEvent
event EventHandler<CollectionInfoChangedEventArgs> CollectionInfoChangedEvent
Event Type
MonitorClientsChanged
Raised when the list of connected monitoring agents changes.
event EventHandler MonitorClientsChanged