Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
emulab-devel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
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
Emmanuel Cecchet
emulab-devel
Commits
7936160a
Commit
7936160a
authored
22 years ago
by
Robert Ricci
Browse files
Options
Downloads
Patches
Plain Diff
Now sticks stddev and packet loss rates into the database
parent
9bb4ae1b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
db/grabron.in
+9
-6
9 additions, 6 deletions
db/grabron.in
with
9 additions
and
6 deletions
db/grabron.in
+
9
−
6
View file @
7936160a
...
@@ -76,7 +76,7 @@ sub upload_times($$$) {
...
@@ -76,7 +76,7 @@ sub upload_times($$$) {
my
$suceeded
=
0
;
my
$suceeded
=
0
;
my
$failed
=
0
;
my
$failed
=
0
;
foreach
my
$time
(
@times
)
{
foreach
my
$time
(
@times
)
{
my
(
$src
,
$dst
,
$latency
)
=
@$time
;
my
(
$src
,
$dst
,
$latency
,
$stddev
,
$lossrate
)
=
@$time
;
if
(
!
$ipmap
{
$src
})
{
if
(
!
$ipmap
{
$src
})
{
warn
"
Got an IP (
$src
) that's not in the interfaces table
\n
";
warn
"
Got an IP (
$src
) that's not in the interfaces table
\n
";
$failed
++
;
$failed
++
;
...
@@ -107,7 +107,8 @@ sub upload_times($$$) {
...
@@ -107,7 +107,8 @@ sub upload_times($$$) {
DBQueryFatal
("
replace into widearea_recent set IP1='
$src
',
"
.
DBQueryFatal
("
replace into widearea_recent set IP1='
$src
',
"
.
"
IP2='
$dst
', time=
$latency
, node_id1='
$node_id1
',
"
.
"
IP2='
$dst
', time=
$latency
, node_id1='
$node_id1
',
"
.
"
iface1='
$iface1
', node_id2='
$node_id2
', iface2='
$iface2
',
"
.
"
iface1='
$iface1
', node_id2='
$node_id2
', iface2='
$iface2
',
"
.
"
bandwidth=
$bandwidth
");
"
bandwidth=
$bandwidth
, time_stddev='
$stddev
',
"
.
"
lossrate='
$lossrate
'
");
}
}
...
@@ -189,16 +190,18 @@ sub get_times($) {
...
@@ -189,16 +190,18 @@ sub get_times($) {
my
@return
;
my
@return
;
foreach
my
$line
(
@data
)
{
foreach
my
$line
(
@data
)
{
chomp
$line
;
chomp
$line
;
if
(
!
(
$line
=~
/(\d+\.\d+.\d+\.\d+)\s+(\d+\.\d+.\d+\.\d+)\s+(\d+.\d+)\s+(\d+)\s+(\d+)/
)
)
{
if
(
!
(
$line
=~
/(\d+\.\d+.\d+\.\d+)\s+(\d+\.\d+.\d+\.\d+)\s+(\d+
\.\d+)\s+(\d+\
.\d+)\s+(\d+)\s+(\d+)/
)
)
{
warn
"
Bad data line:
$line
\n
";
warn
"
Bad data line:
$line
\n
";
next
;
next
;
}
}
my
(
$src
,
$dst
,
$avg
,
$successful
,
$unsuccessful
)
=
(
$
1
,
$
2
,
$
3
,
$
4
,
$
5
);
my
(
$src
,
$dst
,
$avg
,
$stddev
,
$successful
,
$unsuccessful
)
=
(
$
1
,
$
2
,
$
3
,
$
4
,
$
5
,
$
6
);
if
(
$successful
>
0
)
{
if
(
$successful
>
0
)
{
push
@return
,
[
$src
,
$dst
,
$avg
];
my
$lossrate
=
(
$unsuccessful
*
1.0
)
/
(
$successful
+
$unsuccessful
);
push
@return
,
[
$src
,
$dst
,
$avg
,
$stddev
,
$lossrate
];
}
elsif
(
$unsuccessful
>
0
)
{
}
elsif
(
$unsuccessful
>
0
)
{
push
@return
,
[
$src
,
$dst
,
undef
];
push
@return
,
[
$src
,
$dst
,
undef
,
$stddev
,
1
];
}
}
}
}
...
...
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