emit correct count for listeners.totalReceivedMessageCount
@@ -50,6 +50,11 @@ func (i IngressServer) BatchSender(s plumbing.DopplerIngress_BatchSenderServer)
continue
}
+ // metric-documentation-v1: (listeners.totalReceivedMessageCount)
+ // Total number of messages received by doppler.
+ i.batcher.BatchCounter("listeners.totalReceivedMessageCount").
+ Increment()
+
count++
if count >= 1000 || time.Since(lastEmitted) > 5*time.Second {
// metric-documentation-v2: (loggregator.doppler.ingress) Number of received
@@ -59,11 +64,6 @@ func (i IngressServer) BatchSender(s plumbing.DopplerIngress_BatchSenderServer)
metric.WithVersion(2, 0),
)
- // metric-documentation-v1: (listeners.totalReceivedMessageCount)
- // Total number of messages received by doppler.
- i.batcher.BatchCounter("listeners.totalReceivedMessageCount").
- Increment()
-
log.Printf("Ingressed (v2) %d envelopes", count)
lastEmitted = time.Now()
count = 0
@@ -87,6 +87,11 @@ func (i IngressServer) Sender(s plumbing.DopplerIngress_SenderServer) error {
continue
}
+ // metric-documentation-v1: (listeners.totalReceivedMessageCount)
+ // Total number of messages received by doppler.
+ i.batcher.BatchCounter("listeners.totalReceivedMessageCount").
+ Increment()
+
count++
if count >= 1000 || time.Since(lastEmitted) > 5*time.Second {
// metric-documentation-v2: (loggregator.doppler.ingress) Number of received
@@ -96,11 +101,6 @@ func (i IngressServer) Sender(s plumbing.DopplerIngress_SenderServer) error {
metric.WithVersion(2, 0),
)
- // metric-documentation-v1: (listeners.totalReceivedMessageCount)
- // Total number of messages received by doppler.
- i.batcher.BatchCounter("listeners.totalReceivedMessageCount").
- Increment()
-
log.Printf("Ingressed (v2) %d envelopes", count)
lastEmitted = time.Now()
count = 0
