Skip to content

Commit

Permalink
Add close to tests and remove message counter
Browse files Browse the repository at this point in the history
  • Loading branch information
Bigomby committed Jul 26, 2016
1 parent cd690ba commit 46d25eb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 19 deletions.
19 changes: 0 additions & 19 deletions rbforwarder.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package rbforwarder
import (
"bytes"
"sync/atomic"
"time"

"github.com/Sirupsen/logrus"
"github.com/redBorder/rbforwarder/pipeline"
Expand Down Expand Up @@ -74,24 +73,6 @@ func (f *RBForwarder) Start() {
// Start the report handler
f.reportHandler.Init()

if f.config.ShowCounter > 0 {
go func() {
for {
timer := time.NewTimer(
time.Duration(f.config.ShowCounter) * time.Second,
)
<-timer.C
if f.counter > 0 {
Logger.Infof(
"Messages per second %d",
f.counter/uint64(f.config.ShowCounter),
)
f.counter = 0
}
}
}()
}

// Get reports from the backend and send them to the reportHandler
done := make(chan struct{})
go func() {
Expand Down
4 changes: 4 additions & 0 deletions rbforwarder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,5 +119,9 @@ func TestBackend(t *testing.T) {
So(report.Metadata["message_id"], ShouldEqual, "test123")
})
})

Reset(func() {
rbforwarder.Close()
})
})
}

0 comments on commit 46d25eb

Please sign in to comment.