forked from External/mediamtx
api, metrics: add number of bytes received and sent from/to all entities (#1235)
* 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
This commit is contained in:
parent
71ef9b47ab
commit
8bee4af86a
25 changed files with 338 additions and 277 deletions
|
|
@ -198,8 +198,7 @@ func TestReader(t *testing.T) {
|
|||
for _, ca := range cases {
|
||||
t.Run(ca.name, func(t *testing.T) {
|
||||
var buf bytes.Buffer
|
||||
bcr := bytecounter.NewReader(&buf)
|
||||
r := NewReader(bcr, func(count uint32) error {
|
||||
r := NewReader(bytecounter.NewReader(&buf), func(count uint32) error {
|
||||
return nil
|
||||
})
|
||||
|
||||
|
|
@ -224,14 +223,14 @@ func TestReaderAcknowledge(t *testing.T) {
|
|||
onAckCalled := make(chan struct{})
|
||||
|
||||
var buf bytes.Buffer
|
||||
bcr := bytecounter.NewReader(&buf)
|
||||
r := NewReader(bcr, func(count uint32) error {
|
||||
bc := bytecounter.NewReader(&buf)
|
||||
r := NewReader(bc, func(count uint32) error {
|
||||
close(onAckCalled)
|
||||
return nil
|
||||
})
|
||||
|
||||
if ca == "overflow" {
|
||||
bcr.SetCount(4294967096)
|
||||
bc.SetCount(4294967096)
|
||||
r.lastAckCount = 4294967096
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue