1
0
Fork 0
This commit is contained in:
Matt Goodall 2013-04-22 10:17:33 +01:00
parent 001fb31173
commit 40fc5bc2ad
1 changed files with 5 additions and 5 deletions

View File

@ -80,15 +80,15 @@ func consumer(args []string) {
count := 0 count := 0
throughputCount := 0 throughputCount := 0
go func() { go func() {
throughput := time.Tick(time.Second) throughput := time.Tick(time.Second)
total := time.Tick(time.Second * 5) total := time.Tick(time.Second * 5)
for { for {
select { select {
case <- throughput: case <-throughput:
log.Printf("throughput: %d msgs/s\n", count - throughputCount) log.Printf("throughput: %d msgs/s\n", count-throughputCount)
throughputCount = count throughputCount = count
case <- total: case <-total:
log.Printf("total: %d\n", count) log.Printf("total: %d\n", count)
} }
} }
@ -96,7 +96,7 @@ func consumer(args []string) {
for stanza := range x.In { for stanza := range x.In {
if _, ok := stanza.(*xmpp.Message); ok { if _, ok := stanza.(*xmpp.Message); ok {
count ++ count++
} }
} }
} }