Пример #1
0
func main() {
	Closeables = make([]io.Closer, 0, 5)
	flag.Parse()
	conf.InitConfig()
	prometheus.Init()
	if conf.Global == nil {
		log.Fatal("Configuration couldn't be parsed")
	}
	ConfigureLogger()
	CreateDataStore()
	prometheus.ProcessStoredValues(DataStore)
	if *importPath != "" {
		ImportData()
	}
	closeables, err := Assemble()
	Closeables = append(Closeables, closeables...)
	ListenToSig()
	log.Errorf("Error assembling application: %v", err)
}
Пример #2
0
func ExecuteCompletePipe(t *testing.T, store data.Nodeinfostore) {
	prometheus.Init()
	assert := assert.New(t)
	testReceiver := &TestDataReceiver{TestData: TestData}

	i := 0
	closeables, err := assemble.BuildPipelines(store, testReceiver, func(response data.ParsedResponse) {
		i = i + 1
	})
	assert.Nil(err)

	for i < len(TestData) {
		time.Sleep(time.Millisecond * 1)
	}

	for _, closable := range closeables {
		closable.Close()
	}

	assert.Equal(len(TestData), i)
}