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) }
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 }