func (p *CounterProcessor) Process(e *events.Envelope) []metrics.WMetric { processedMetrics := make([]metrics.WMetric, 1) counterEvent := e.GetCounterEvent() processedMetrics[0] = *p.ProcessCounter(counterEvent) return processedMetrics }
func CounterEvent(msg *events.Envelope) Event { counterEvent := msg.GetCounterEvent() fields := logrus.Fields{ "origin": msg.GetOrigin(), "name": counterEvent.GetName(), "delta": counterEvent.GetDelta(), "total": counterEvent.GetTotal(), } return Event{ Fields: fields, Msg: "", Type: msg.GetEventType().String(), } }