Exemplo n.º 1
0
func export(s core.EventSink, data *core.EventBatch) {
	startTime := time.Now()
	defer exporterDuration.
		WithLabelValues(s.Name()).
		Observe(float64(time.Since(startTime)) / float64(time.Microsecond))
	s.ExportEvents(data)
}
Exemplo n.º 2
0
func doThreeBatches(manager core.EventSink) time.Duration {
	now := time.Now()
	batch := core.EventBatch{
		Timestamp: now,
		Events:    []*kube_api.Event{},
	}

	manager.ExportEvents(&batch)
	manager.ExportEvents(&batch)
	manager.ExportEvents(&batch)

	elapsed := time.Now().Sub(now)
	return elapsed
}