log traffic bytes only once every few seconds, along with OnMessage & datachannel.Send counts, to prevent flooded logs

This commit is contained in:
Serene Han 2016-02-18 14:15:22 -08:00
parent a1b7e01c54
commit c4215b5614
3 changed files with 83 additions and 5 deletions

View file

@ -24,6 +24,10 @@ func TestConnect(t *testing.T) {
Convey("WebRTC Connection", func() {
c := new(webRTCConn)
c.BytesInfo = &BytesInfo{
inboundChan: make(chan int), outboundChan: make(chan int),
inbound: 0, outbound: 0, inEvents: 0, outEvents: 0,
}
So(c.buffer.Bytes(), ShouldEqual, nil)
Convey("SendData buffers when datachannel is nil", func() {