Beispiel #1
0
func main() {
	configFilePath := flag.String("config", "config/config.json", "Path to config params for the consumer")
	flag.Parse()

	config, err := config.Parse(*configFilePath)
	if err != nil {
		log.Fatalf("Error parsing config: %s", err.Error())
	}

	tokenFetcher := &uaatokenfetcher.UAATokenFetcher{
		UaaUrl:                config.UAAURL,
		Username:              config.Username,
		Password:              config.Password,
		InsecureSSLSkipVerify: config.InsecureSSLSkipVerify,
	}

	metrics_nozzle := nozzle.NewNozzle(config, tokenFetcher, os.Stdout, os.Stderr)
	metrics_nozzle.Start()

}
		}

		configuration = &config.ConsumerConfig{
			UAAURL:                 fakeUAA.URL(),
			Username:               "******",
			Password:               "******",
			InsecureSSLSkipVerify:  true,
			DopplerAddr:            strings.Replace(fakeFirehose.URL(), "http:", "ws:", 1),
			FirehoseSubscriptionId: "metrics-consumer-tests",
			OriginID:               "service-metrics-test",
		}

		logOutput = gbytes.NewBuffer()
		log.SetOutput(logOutput)

		metrics_nozzle = nozzle.NewNozzle(configuration, tokenFetcher, GinkgoWriter, GinkgoWriter)
	})

	JustBeforeEach(func() {
		// adding data with origin "service-metrics-test"
		for i := 0; i < 10; i++ {
			envelope := events.Envelope{
				Origin:    proto.String("service-metrics-test"),
				Timestamp: proto.Int64(1000000000),
				EventType: events.Envelope_ValueMetric.Enum(),
				ValueMetric: &events.ValueMetric{
					Name:  proto.String(fmt.Sprintf("filteredMetric-%d", i)),
					Value: proto.Float64(float64(i)),
					Unit:  proto.String("gauge"),
				},
				Deployment: proto.String("service-metrics-test"),