fix for arm32 (#5130)

Signed-off-by: Saurabh Deoras <sdeoras@gmail.com>
This commit is contained in:
Saurabh Deoras 2019-01-23 07:09:01 -08:00 committed by Matt Keeler
parent 07ec7988a4
commit 2eca399d4c
1 changed files with 3 additions and 3 deletions

View File

@ -48,7 +48,7 @@ type Listener struct {
logger *log.Logger logger *log.Logger
// Gauge to track current open connections // Gauge to track current open connections
activeConns int64 activeConns int32
connWG sync.WaitGroup connWG sync.WaitGroup
metricPrefix string metricPrefix string
metricLabels []metrics.Label metricLabels []metrics.Label
@ -228,12 +228,12 @@ func (l *Listener) handleConn(src net.Conn) {
// trackConn increments the count of active conns and returns a func() that can // trackConn increments the count of active conns and returns a func() that can
// be deferred on to decrement the counter again on connection close. // be deferred on to decrement the counter again on connection close.
func (l *Listener) trackConn() func() { func (l *Listener) trackConn() func() {
c := atomic.AddInt64(&l.activeConns, 1) c := atomic.AddInt32(&l.activeConns, 1)
metrics.SetGaugeWithLabels([]string{l.metricPrefix, "conns"}, float32(c), metrics.SetGaugeWithLabels([]string{l.metricPrefix, "conns"}, float32(c),
l.metricLabels) l.metricLabels)
return func() { return func() {
c := atomic.AddInt64(&l.activeConns, -1) c := atomic.AddInt32(&l.activeConns, -1)
metrics.SetGaugeWithLabels([]string{l.metricPrefix, "conns"}, float32(c), metrics.SetGaugeWithLabels([]string{l.metricPrefix, "conns"}, float32(c),
l.metricLabels) l.metricLabels)
} }