Skip to content

Commit

Permalink
Fix issue dcu#127
Browse files Browse the repository at this point in the history
  • Loading branch information
vkuznet committed Jun 26, 2020
1 parent 8f53431 commit 9a287e6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions collector/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,11 +360,13 @@ type PreloadStats struct {

// Export exposes the preload stats.
func (preloadStats *PreloadStats) Export(ch chan<- prometheus.Metric) {
metricsReplPreloadDocsNumTotal.Set(preloadStats.Docs.Num)
metricsReplPreloadDocsTotalMilliseconds.Set(preloadStats.Docs.TotalMillis)
if preloadStats != nil {
metricsReplPreloadDocsNumTotal.Set(preloadStats.Docs.Num)
metricsReplPreloadDocsTotalMilliseconds.Set(preloadStats.Docs.TotalMillis)

metricsReplPreloadIndexesNumTotal.Set(preloadStats.Indexes.Num)
metricsReplPreloadIndexesTotalMilliseconds.Set(preloadStats.Indexes.TotalMillis)
metricsReplPreloadIndexesNumTotal.Set(preloadStats.Indexes.Num)
metricsReplPreloadIndexesTotalMilliseconds.Set(preloadStats.Indexes.TotalMillis)
}
}

// StorageStats are the stats associated with the storage.
Expand Down

1 comment on commit 9a287e6

@pauldintel
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it supposed to work for any mongodb version from 4.4 to 7.x ? I am using 7.x and still has this Panic error ..

Please sign in to comment.