func Test_CollectServerStatus(t *testing.T) { shared.ParseEnabledGroups("assers,durability,backgrond_flushing,connections,extra_info,global_lock,index_counters,network,op_counters,memory,locks,metrics,cursors") collector := NewMongodbCollector(MongodbCollectorOpts{URI: "localhost"}) serverStatus := collector.collectServerStatus(nil) if serverStatus.Asserts == nil { t.Error("Error loading document.") } }
func main() { flag.Parse() shared.LoadGroupsDesc() shared.ParseEnabledGroups(*enabledGroupsFlag) mongodbCollector := collector.NewMongodbCollector(collector.MongodbCollectorOpts{ URI: *mongodbUriFlag, }) prometheus.MustRegister(mongodbCollector) startWebServer() }
func Test_CollectServerStatus(t *testing.T) { shared.ParseEnabledGroups("assers,durability,backgrond_flushing,connections,extra_info,global_lock,index_counters,network,op_counters,memory,locks,metrics,cursors") collector := NewMongodbCollector(MongodbCollectorOpts{URI: "localhost"}) go collector.Collect(nil) }
func main() { flag.Parse() shared.ParseEnabledGroups(*enabledGroupsFlag) startWebServer() }