@@ -376,11 +376,13 @@ type PreloadStats struct {
376
376
377
377
// Export exposes the preload stats.
378
378
func (preloadStats * PreloadStats ) Export (ch chan <- prometheus.Metric ) {
379
- metricsReplPreloadDocsNumTotal .Set (preloadStats .Docs .Num )
380
- metricsReplPreloadDocsTotalMilliseconds .Set (preloadStats .Docs .TotalMillis )
379
+ if preloadStats != nil {
380
+ metricsReplPreloadDocsNumTotal .Set (preloadStats .Docs .Num )
381
+ metricsReplPreloadDocsTotalMilliseconds .Set (preloadStats .Docs .TotalMillis )
381
382
382
- metricsReplPreloadIndexesNumTotal .Set (preloadStats .Indexes .Num )
383
- metricsReplPreloadIndexesTotalMilliseconds .Set (preloadStats .Indexes .TotalMillis )
383
+ metricsReplPreloadIndexesNumTotal .Set (preloadStats .Indexes .Num )
384
+ metricsReplPreloadIndexesTotalMilliseconds .Set (preloadStats .Indexes .TotalMillis )
385
+ }
384
386
}
385
387
386
388
// StorageStats are the stats associated with the storage.
@@ -420,8 +422,8 @@ func (cursorStats *CursorStats) Export(ch chan<- prometheus.Metric) {
420
422
421
423
// TTLStats are the stats with a ttl index
422
424
type TTLStats struct {
423
- DeletedDocuments float64 `bson:"deletedDocuments"`
424
- Passes float64 `bson:"passes"`
425
+ DeletedDocuments float64 `bson:"deletedDocuments"`
426
+ Passes float64 `bson:"passes"`
425
427
}
426
428
427
429
// Export exports the ttl stats.
@@ -432,8 +434,8 @@ func (ttlStats *TTLStats) Export(ch chan<- prometheus.Metric) {
432
434
433
435
// QueryStats are the stats with a ttl index
434
436
type QueryStats struct {
435
- PlanCacheSize float64 `bson:"planCacheTotalSizeEstimateBytes"`
436
- UpdateCount float64 `bson:"updateOneOpStyleBroadcastWithExactIDCount"`
437
+ PlanCacheSize float64 `bson:"planCacheTotalSizeEstimateBytes"`
438
+ UpdateCount float64 `bson:"updateOneOpStyleBroadcastWithExactIDCount"`
437
439
}
438
440
439
441
// Export exports the query stats.
0 commit comments