Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sfu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alain Takoudjou
sfu
Commits
98a1776c
Commit
98a1776c
authored
May 02, 2020
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Include jitter in track statistics.
parent
4dd24571
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
2 deletions
+17
-2
group.go
group.go
+10
-1
sfu.go
sfu.go
+7
-1
No files found.
group.go
View file @
98a1776c
...
@@ -654,6 +654,7 @@ type trackStats struct {
...
@@ -654,6 +654,7 @@ type trackStats struct {
bitrate
uint64
bitrate
uint64
maxBitrate
uint64
maxBitrate
uint64
loss
uint8
loss
uint8
jitter
time
.
Duration
}
}
func
getGroupStats
()
[]
groupStats
{
func
getGroupStats
()
[]
groupStats
{
...
@@ -701,10 +702,14 @@ func getClientStats(c *client) clientStats {
...
@@ -701,10 +702,14 @@ func getClientStats(c *client) clientStats {
if
expected
==
0
{
if
expected
==
0
{
expected
=
1
expected
=
1
}
}
loss
:=
uint8
(
lost
*
100
/
expected
)
jitter
:=
time
.
Duration
(
t
.
jitter
.
Jitter
())
*
(
time
.
Second
/
time
.
Duration
(
t
.
jitter
.
HZ
()))
conns
.
tracks
=
append
(
conns
.
tracks
,
trackStats
{
conns
.
tracks
=
append
(
conns
.
tracks
,
trackStats
{
bitrate
:
uint64
(
t
.
rate
.
Estimate
())
*
8
,
bitrate
:
uint64
(
t
.
rate
.
Estimate
())
*
8
,
maxBitrate
:
atomic
.
LoadUint64
(
&
t
.
maxBitrate
),
maxBitrate
:
atomic
.
LoadUint64
(
&
t
.
maxBitrate
),
loss
:
uint8
(
lost
*
100
/
expected
),
loss
:
loss
,
jitter
:
jitter
,
})
})
}
}
cs
.
up
=
append
(
cs
.
up
,
conns
)
cs
.
up
=
append
(
cs
.
up
,
conns
)
...
@@ -717,10 +722,14 @@ func getClientStats(c *client) clientStats {
...
@@ -717,10 +722,14 @@ func getClientStats(c *client) clientStats {
conns
:=
connStats
{
id
:
down
.
id
}
conns
:=
connStats
{
id
:
down
.
id
}
for
_
,
t
:=
range
down
.
tracks
{
for
_
,
t
:=
range
down
.
tracks
{
loss
:=
atomic
.
LoadUint32
(
&
t
.
loss
)
loss
:=
atomic
.
LoadUint32
(
&
t
.
loss
)
jitter
:=
time
.
Duration
(
atomic
.
LoadUint32
(
&
t
.
jitter
))
*
time
.
Second
/
time
.
Duration
(
t
.
track
.
Codec
()
.
ClockRate
)
conns
.
tracks
=
append
(
conns
.
tracks
,
trackStats
{
conns
.
tracks
=
append
(
conns
.
tracks
,
trackStats
{
bitrate
:
uint64
(
t
.
rate
.
Estimate
())
*
8
,
bitrate
:
uint64
(
t
.
rate
.
Estimate
())
*
8
,
maxBitrate
:
t
.
maxBitrate
.
Get
(
mono
.
Microseconds
()),
maxBitrate
:
t
.
maxBitrate
.
Get
(
mono
.
Microseconds
()),
loss
:
uint8
((
loss
*
100
)
/
256
),
loss
:
uint8
((
loss
*
100
)
/
256
),
jitter
:
jitter
,
})
})
}
}
cs
.
down
=
append
(
cs
.
down
,
conns
)
cs
.
down
=
append
(
cs
.
down
,
conns
)
...
...
sfu.go
View file @
98a1776c
...
@@ -171,9 +171,15 @@ func statsHandler(w http.ResponseWriter, r *http.Request) {
...
@@ -171,9 +171,15 @@ func statsHandler(w http.ResponseWriter, r *http.Request) {
fmt
.
Fprintf
(
w
,
"<td>"
)
fmt
.
Fprintf
(
w
,
"<td>"
)
printBitrate
(
w
,
t
.
bitrate
,
t
.
maxBitrate
)
printBitrate
(
w
,
t
.
bitrate
,
t
.
maxBitrate
)
fmt
.
Fprintf
(
w
,
"</td>"
)
fmt
.
Fprintf
(
w
,
"</td>"
)
fmt
.
Fprintf
(
w
,
"<td>%d%%</td>
</tr>
\n
"
,
fmt
.
Fprintf
(
w
,
"<td>%d%%</td>"
,
t
.
loss
,
t
.
loss
,
)
)
if
t
.
jitter
>
0
{
fmt
.
Fprintf
(
w
,
"<td>%v</td>"
,
t
.
jitter
)
}
else
{
fmt
.
Fprintf
(
w
,
"<td></td>"
)
}
fmt
.
Fprintf
(
w
,
"</tr>"
)
}
}
for
_
,
gs
:=
range
stats
{
for
_
,
gs
:=
range
stats
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment