Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
flame-clmc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
flame
flame-clmc
Commits
189e796a
Commit
189e796a
authored
7 years ago
by
Stephen C Phillips
Browse files
Options
Downloads
Patches
Plain Diff
Improves client error reporting
parent
83581239
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
test/streaming/report.sh
+19
-2
19 additions, 2 deletions
test/streaming/report.sh
test/streaming/run.sh
+2
-1
2 additions, 1 deletion
test/streaming/run.sh
test/streaming/stop.sh
+2
-1
2 additions, 1 deletion
test/streaming/stop.sh
with
23 additions
and
4 deletions
test/streaming/report.sh
+
19
−
2
View file @
189e796a
#!/bin/bash
# This script reads stdin.
# It is used by the run.sh script and receives the output of the cvlc client.
# It counts the number of times the frame "dropping" error is seen and every 10 times it sends a message to telegraf reporting "another 10" errors.
if
[
"$#"
-ne
1
]
;
then
echo
"Error: illegal number of arguments: "
$#
echo
"Usage: report.sh <client number>"
exit
fi
COUNTER
=
$1
TELEGRAF
=
http://localhost:8186
ERR_COUNT
=
0
while
read
line
;
do
curl
-i
-XPOST
"
${
TELEGRAF
}
/write?precision=s"
--data-binary
"vlc,client=
${
COUNTER
}
drop_error=1
$(
date
+%s
)
"
>
& /dev/null
done
if
[[
$line
=
*
"dropping"
*
]]
;
then
ERR_COUNT
=
$((
$ERR_COUNT
+
1
))
fi
TEN
=
$((
ERR_COUNT
%
10
))
if
[
$TEN
-eq
0
]
;
then
curl
-i
-XPOST
"
${
TELEGRAF
}
/write?precision=s"
--data-binary
"vlc,client=
${
COUNTER
}
drop_error=10
$(
date
+%s
)
"
>
& /dev/null
fi
done
\ No newline at end of file
This diff is collapsed.
Click to expand it.
test/streaming/run.sh
+
2
−
1
View file @
189e796a
...
...
@@ -47,7 +47,8 @@ STREAM_URI=$2
COUNTER
=
0
MAX_CLIENTS
=
$3
while
[
$COUNTER
-lt
$MAX_CLIENTS
]
;
do
cvlc
-Vdummy
--no-audio
$STREAM_URI
2>&1 |
tee
$TEST_DIR
/stdout
$COUNTER
|
grep
"dropping"
| /home/ubuntu/flame-clmc/test/streaming/report.sh
${
COUNTER
}
&
# run cvlc headless, redirect stderr into stdout, pipe that into the report.sh script
cvlc
-Vdummy
--no-audio
$STREAM_URI
2>&1 | /home/ubuntu/flame-clmc/test/streaming/report.sh
${
COUNTER
}
&
sleep
1
let
COUNTER
=
COUNTER+1
done
...
...
This diff is collapsed.
Click to expand it.
test/streaming/stop.sh
+
2
−
1
View file @
189e796a
#!/bin/bash
for
pid
in
$(
ps
-ef
|
grep
"/usr/bin/vlc"
|
awk
'{print $2}'
)
;
do
kill
-9
$pid
;
done
\ No newline at end of file
for
pid
in
$(
ps
-ef
|
grep
"/usr/bin/vlc"
|
awk
'{print $2}'
)
;
do
kill
-9
$pid
;
done
# TODO: 'killall vlc' should work: need to test though
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment