Skip to content

Commit

Permalink
remove unnecessary code
Browse files Browse the repository at this point in the history
  • Loading branch information
masaruhoshi committed Jun 1, 2021
1 parent 37b4e07 commit 0fc6535
Showing 1 changed file with 0 additions and 40 deletions.
40 changes: 0 additions & 40 deletions exporter/v1_compatibility.go
Original file line number Diff line number Diff line change
Expand Up @@ -1333,46 +1333,6 @@ func dbstatsMetrics(ctx context.Context, client *mongo.Client, l *logrus.Logger)
metrics = append(metrics, metric)
}
}
} else {
labels := prometheus.Labels{
"db": member.Name,
}

name := "mongodb_mongod_db_data_size_bytes"
help := "The total size in bytes of the uncompressed data held in this database"

d := prometheus.NewDesc(name, help, nil, labels)
metric, err := prometheus.NewConstMetric(d, prometheus.GaugeValue, float64(member.DataSize))
if err == nil {
metrics = append(metrics, metric)
}

name = "mongodb_mongod_db_indexes_total"
help = "Contains a count of the total number of indexes across all collections in the database"

d = prometheus.NewDesc(name, help, nil, labels)
metric, err = prometheus.NewConstMetric(d, prometheus.GaugeValue, float64(member.Indexes))
if err == nil {
metrics = append(metrics, metric)
}

name = "mongodb_mongod_db_index_size_bytes"
help = "The total size in bytes of all indexes created on this database"

d = prometheus.NewDesc(name, help, nil, labels)
metric, err = prometheus.NewConstMetric(d, prometheus.GaugeValue, float64(member.IndexSize))
if err == nil {
metrics = append(metrics, metric)
}

name = "mongodb_mongod_db_collections_total"
help = "Total number of collections"

d = prometheus.NewDesc(name, help, nil, labels)
metric, err = prometheus.NewConstMetric(d, prometheus.GaugeValue, float64(member.Collections))
if err == nil {
metrics = append(metrics, metric)
}
}
}

Expand Down

0 comments on commit 0fc6535

Please sign in to comment.