Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
eb1d74f3
Commit
eb1d74f3
authored
Apr 20, 2006
by
Dan Gebhardt
Browse files
Added comments/markers to assist in adding reliable result transfer.
See: #MARK_RELIABLE sections
parent
a25304f3
Changes
1
Hide whitespace changes
Inline
Side-by-side
pelab/bgmon/bgmon.pl
View file @
eb1d74f3
...
...
@@ -44,12 +44,17 @@ sub usage {
#*****************************************
my
%MAX_SIMU_TESTS
=
(
latency
=>
"
10
",
bw
=>
"
1
");
# a ratio of testing period to wait after a test failure
my
%TEST_FAIL_RETRY
=
(
latency
=>
0.3
,
bw
=>
0.1
);
#MARK_RELIABLE
# each result waiting to be acked has an id number and corresponding file
my
$resultDBlimit
=
100
;
my
$resIndex
=
0
;
my
%testevents
=
();
#queue for each test type containing tests that need to
# be run, but couldn't, due to MAX_SIMU_TESTS.
# keys are test types, values are lists
...
...
@@ -185,9 +190,10 @@ while (1) {
"
result
"
=>
$parsedData
,
"
tstamp
"
=>
$testevents
{
$destaddr
}{
$testtype
}
{"
tstamp
"}
);
#save results to local DB
#MARK_RELIABLE
#save result to local DB
saveTestToLocalDB
(
\
%results
);
#send result
s
to remote DB
#send result to remote DB
sendResults
(
\
%results
,
$resIndex
);
$resIndex
=
(
$resIndex
+
1
)
%
$resultDBlimit
;
...
...
@@ -247,8 +253,9 @@ while (1) {
}
}
#check for results that have not been sent due to error
#MARK_RELIABLE
#check for results that could not be sent due to error
# TODO: horribly inefficient...
for
(
my
$i
=
0
;
$i
<
$resultDBlimit
;
$i
++
){
if
(
-
e
createDBfilename
(
$i
)
){
#resend
...
...
@@ -264,11 +271,6 @@ while (1) {
}
}
#sleep for a time
# my $tmp = select(undef, undef, undef, 0.25);
# open NULL,"/dev/null";
# printTimeEvents();
}
#############################################################################
...
...
@@ -530,6 +532,7 @@ sub printTimeEvents {
#############################################################################
#MARK_RELIABLE
sub
saveTestToLocalDB
($)
{
#save result to DB's in files.
...
...
@@ -595,7 +598,8 @@ sub sendResults($$){
$results
->
{
tstamp
}
)
)
{
warn
"
Could not add attribute to notification
\n
";
}
#send notification
#MARK_RELIABLE
#send notification, and check for send error from event system
if
(
!
event_notify
(
$handle
,
$notification_res
))
{
warn
("
could not send test event notification
");
$f_success
=
0
;
...
...
@@ -607,10 +611,11 @@ sub sendResults($$){
# $f_success = 0;
# }
#MARK_RELIABLE
#check for successful send
if
(
$f_success
==
1
){
#delete file of event result
print
"
successful send:
";
print
"
successful send:
";
print
"
$results
->{testtype}=
$results
->{result}
";
unlink
(
createDBfilename
(
$index
)
);
}
...
...
Write
Preview
Supports
Markdown
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