mirror of
https://github.com/bluenviron/mediamtx
synced 2025-01-27 09:23:38 +00:00
8bee4af86a
* API: number of bytes received/sent from/to RTSP connections * API: number of bytes received/sent from/to RTSP sessions * API: number of bytes received/sent from/to RTMP connections * API: number of bytes sent to HLS connections * API: number of bytes received from paths * metrics of all the above
19 lines
276 B
Go
19 lines
276 B
Go
package bytecounter
|
|
|
|
import (
|
|
"bytes"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestWriter(t *testing.T) {
|
|
var buf bytes.Buffer
|
|
|
|
w := NewWriter(&buf)
|
|
w.SetCount(100)
|
|
|
|
w.Write(bytes.Repeat([]byte{0x01}, 64))
|
|
require.Equal(t, uint64(100+64), w.Count())
|
|
}
|