do not include recorder and HLS muxer in sent bytes (#4380) (#5039)

in API (/paths/list, /paths/get) and metrics (paths_bytes_sent), the
amount of sent bytes was increased even in case of writes to the
recorder and HLS muxer, which are not generating network traffic. This
fixes the issue.
This commit is contained in:
Alessandro Ros
2025-09-29 09:28:04 +02:00
committed by GitHub
parent ada39d22cd
commit cd80814009
28 changed files with 615 additions and 656 deletions

View File

@@ -145,10 +145,9 @@ func TestServerPublish(t *testing.T) {
recv := make(chan struct{})
reader := test.NilLogger
r := &stream.Reader{Parent: test.NilLogger}
strm.AddReader(
reader,
r.OnData(
strm.Desc.Medias[0],
strm.Desc.Medias[0].Formats[0],
func(u unit.Unit) error {
@@ -161,8 +160,8 @@ func TestServerPublish(t *testing.T) {
return nil
})
strm.StartReader(reader)
defer strm.RemoveReader(reader)
strm.AddReader(r)
defer strm.RemoveReader(r)
err = w.WriteH264(
test.FormatH264,
@@ -259,7 +258,7 @@ func TestServerRead(t *testing.T) {
defer conn.Close()
go func() {
strm.WaitRunningReader()
time.Sleep(500 * time.Millisecond)
strm.WriteUnit(desc.Medias[0], desc.Medias[0].Formats[0], &unit.H264{
Base: unit.Base{