Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
M
mp-web
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Code Review
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Maalepaaler
mp-web
Commits
7013a13a
Commit
7013a13a
authored
Mar 05, 2015
by
Olav Kvittem
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Kjorte for mange tester, la til akkumulert kurve over klokketid
parent
b23f11bb
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
347 additions
and
54 deletions
+347
-54
body-bs.html
body-bs.html
+4
-4
head-bs.html
head-bs.html
+5
-5
iperf/iperf-json.js
iperf/iperf-json.js
+140
-2
iperf/iperf-x.js
iperf/iperf-x.js
+120
-1
mp-web-bs.html
mp-web-bs.html
+4
-4
mp-web-main-js.html
mp-web-main-js.html
+1
-1
mp-web-main-js.php
mp-web-main-js.php
+7
-7
top-menu-bs.html
top-menu-bs.html
+6
-6
yt/jsbandwidth-body.html
yt/jsbandwidth-body.html
+1
-0
yt/jsbandwidth.js
yt/jsbandwidth.js
+59
-24
No files found.
body-bs.html
View file @
7013a13a
...
...
@@ -3,7 +3,7 @@
<div
class=
"container"
>
<div
class=
"navbar-header"
>
<button
type=
"button"
class=
"navbar-toggle"
data-toggle=
"collapse"
data-target=
".navbar-collapse"
>
<span
class=
"sr-only"
>
Toggle navigation
</span>
<span
class=
"icon-bar"
></span>
<span
class=
"icon-bar"
></span>
<span
class=
"icon-bar"
></span>
</button>
<a
class=
"navbar-brand"
href=
"http://www.uninett.no/"
><img
src=
"/uninett-theme/images/UNINETT_logo.svg"
alt=
"Uninett logo"
type=
"image/svg+xml"
></a>
<a
class=
"navbar-brand"
href=
"http://www.uninett.no/"
><img
src=
"/
mp-web/
uninett-theme/images/UNINETT_logo.svg"
alt=
"Uninett logo"
type=
"image/svg+xml"
></a>
</div>
<div
class=
"navbar-department"
>
...
...
@@ -32,7 +32,7 @@
<div
class=
"col-lg-12"
>
<div
class=
"footer-uninett"
>
<div
class=
"footer-content-uninett"
>
<div
class=
"footer-logo"
>
<img
src=
"/uninett-theme/images/Uninett_pil_rod.svg"
alt=
"Uninett logo"
type=
"image/svg+xml"
></div>
<div
class=
"footer-logo"
>
<img
src=
"/
mp-web/
uninett-theme/images/Uninett_pil_rod.svg"
alt=
"Uninett logo"
type=
"image/svg+xml"
></div>
<div
class=
"footer-uninett-department"
>
UNINETT AS
©
2013-2014,
<a
href=
"mailto:nav-support@uninett.no"
>
nav-support@uninett.no
</a></div>
</div>
...
...
@@ -50,5 +50,5 @@
<!-- Bootstrap core JavaScript -->
<!-- Placed at the end of the document so the pages load faster -->
<script
src=
"/uninett-bootstrap-theme/js/bootstrap.min.js"
></script>
<script
src=
"/uninett-bootstrap-theme/js/holder.js"
></script>
<script
src=
"/
mp-web/
uninett-bootstrap-theme/js/bootstrap.min.js"
></script>
<script
src=
"/
mp-web/
uninett-bootstrap-theme/js/holder.js"
></script>
head-bs.html
View file @
7013a13a
...
...
@@ -3,18 +3,18 @@
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<meta
name=
"description"
content=
""
>
<meta
name=
"author"
content=
""
>
<link
rel=
"shortcut icon"
href=
"
base
/uninett-theme/ico/favicon.ico"
>
<link
rel=
"shortcut icon"
href=
"
/mp-web
/uninett-theme/ico/favicon.ico"
>
<!-- Bootstrap core CSS -->
<link
href=
"
base
/uninett-theme/css/bootstrap.min.css"
rel=
"stylesheet"
>
<link
href=
"
/mp-web
/uninett-theme/css/bootstrap.min.css"
rel=
"stylesheet"
>
<!-- Custom styles for this template -->
<link
href=
"
base
/uninett-theme/css/uninett.css"
rel=
"stylesheet"
>
<link
href=
"
/mp-web
/uninett-theme/css/uninett.css"
rel=
"stylesheet"
>
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->
<script
type=
"text/javascript"
src=
"
base
/js/jquery-ui-1.10.3/jquery-1.9.1.js"
>
<!--
<
script
type
=
"
text/javascript
"
src
=
"
base
/js/jquery-ui-1.11.0-beta.2.custom/jquery.js
"
>
</script>
-->
<script
type=
"text/javascript"
src=
"
/mp-web
/js/jquery-ui-1.10.3/jquery-1.9.1.js"
>
<!--
<
script
type
=
"
text/javascript
"
src
=
"
/mp-web
/js/jquery-ui-1.11.0-beta.2.custom/jquery.js
"
>
</script>
-->
iperf/iperf-json.js
View file @
7013a13a
...
...
@@ -240,8 +240,9 @@ function make_select( elm, url){
html
+=
'
<table><tr><td>
'
;
html
+=
'
<input class="btn btn-primary btn-lg" type="submit" value="Test" class=button/>
'
;
html
+=
'
<select id=direction style=width=6em><option value="to">to</option><option value="from">from</option></select>
'
;
html
+=
'
<input id=tr_host value="" placeholder="my host" title="Automatisk utfylling av mleplenavn"></input>
'
;
html
+=
'
<span id=select-house></span>
'
;
html
+=
'
<td><input id=tr_host value="" placeholder="my host" title="Automatic completion(try
\'
mp
\'
)"></input>
'
;
html
+=
'
<select id=tr_host_menu title="Choose host">host menu</select>
'
;
// html+='<span id=select-house></span>';
var
html2
=
'
<td>
'
;
html2
+=
'
for <input id=tr_times value=5 style="width:2em;text-align:right"> seconds</input>
'
;
// html+=', using <input id=tr_size value=64 style="width:3em;text-align:right"> bytes packets</input>';
...
...
@@ -250,6 +251,7 @@ function make_select( elm, url){
html2
+=
'
on port <input id=tr_port value="5001" title="Default port for iperf3 is 5201" style=width:3em></input>
'
;
html2
+=
'
</table>
'
;
html2
+=
'
</form>
'
;
// html+='<button id="toggle">Show menu</button>';
$
(
elm
).
html
(
html
+
html2
);
// make sure something is shown
...
...
@@ -279,6 +281,15 @@ function make_select( elm, url){
// $("#select-house").html(html);
$
(
"
#tr_host
"
).
autocomplete
({
source
:
items
});
// $("#tr_opt").select2();
populateSelect
(
$
(
"
#tr_host_menu
"
).
get
(
0
),
items
);
$
(
'
#tr_host_menu
'
).
on
(
'
change
'
,
function
(){
$
(
'
#tr_host
'
).
val
(
this
.
value
);
});
// $( "#tr_host" ).combobox();
// $( "#tr_host" ).toggle();
// $( "#toggle" ).click(function() {
// $( "#tr_host" ).toggle();
// });
});
request
.
fail
(
function
(
jqXHR
,
status
,
error
){
console
.
log
(
'
Listing beacons faild from
'
+
url
+
'
:
'
+
status
+
'
,
'
+
error
);
...
...
@@ -391,3 +402,130 @@ function ResultsUpload(dlspeed, ulspeed, rtt){
}
})
}
// populates select list from array of items given as objects: { name: 'text', value: 'value' }
function
populateSelect
(
el
,
items
)
{
el
.
options
.
length
=
0
;
if
(
items
.
length
>
0
)
el
.
options
[
0
]
=
new
Option
(
'
or select
'
,
''
);
$
.
each
(
items
,
function
()
{
el
.
options
[
el
.
options
.
length
]
=
new
Option
(
this
,
this
);
});
}
//--------------------------------------------------------------------------------
// jquery combobox from select
(
function
(
$
)
{
$
.
widget
(
"
custom.combobox
"
,
{
_create
:
function
()
{
this
.
wrapper
=
$
(
"
<span>
"
)
.
addClass
(
"
custom-combobox
"
)
.
insertAfter
(
this
.
element
);
this
.
element
.
hide
();
this
.
_createAutocomplete
();
this
.
_createShowAllButton
();
},
_createAutocomplete
:
function
()
{
var
selected
=
this
.
element
.
children
(
"
:selected
"
),
value
=
selected
.
val
()
?
selected
.
text
()
:
""
;
this
.
input
=
$
(
"
<input>
"
)
.
appendTo
(
this
.
wrapper
)
.
val
(
value
)
.
attr
(
"
title
"
,
""
)
.
addClass
(
"
custom-combobox-input ui-widget ui-widget-content ui-state-default ui-corner-left
"
)
.
autocomplete
({
delay
:
0
,
minLength
:
0
,
source
:
$
.
proxy
(
this
,
"
_source
"
)
})
.
tooltip
({
tooltipClass
:
"
ui-state-highlight
"
});
this
.
_on
(
this
.
input
,
{
autocompleteselect
:
function
(
event
,
ui
)
{
ui
.
item
.
option
.
selected
=
true
;
this
.
_trigger
(
"
select
"
,
event
,
{
item
:
ui
.
item
.
option
});
},
autocompletechange
:
"
_removeIfInvalid
"
});
},
_createShowAllButton
:
function
()
{
var
input
=
this
.
input
,
wasOpen
=
false
;
$
(
"
<a>
"
)
.
attr
(
"
tabIndex
"
,
-
1
)
.
attr
(
"
title
"
,
"
Show All Items
"
)
.
tooltip
()
.
appendTo
(
this
.
wrapper
)
.
button
({
icons
:
{
primary
:
"
ui-icon-triangle-1-s
"
},
text
:
false
})
.
removeClass
(
"
ui-corner-all
"
)
.
addClass
(
"
custom-combobox-toggle ui-corner-right
"
)
.
mousedown
(
function
()
{
wasOpen
=
input
.
autocomplete
(
"
widget
"
).
is
(
"
:visible
"
);
})
.
click
(
function
()
{
input
.
focus
();
// Close if already visible
if
(
wasOpen
)
{
return
;
}
// Pass empty string as value to search for, displaying all results
input
.
autocomplete
(
"
search
"
,
""
);
});
},
_source
:
function
(
request
,
response
)
{
var
matcher
=
new
RegExp
(
$
.
ui
.
autocomplete
.
escapeRegex
(
request
.
term
),
"
i
"
);
response
(
this
.
element
.
children
(
"
option
"
).
map
(
function
()
{
var
text
=
$
(
this
).
text
();
if
(
this
.
value
&&
(
!
request
.
term
||
matcher
.
test
(
text
)
)
)
return
{
label
:
text
,
value
:
text
,
option
:
this
};
})
);
},
_removeIfInvalid
:
function
(
event
,
ui
)
{
// Selected an item, nothing to do
if
(
ui
.
item
)
{
return
;
}
// Search for a match (case-insensitive)
var
value
=
this
.
input
.
val
(),
valueLowerCase
=
value
.
toLowerCase
(),
valid
=
false
;
this
.
element
.
children
(
"
option
"
).
each
(
function
()
{
if
(
$
(
this
).
text
().
toLowerCase
()
===
valueLowerCase
)
{
this
.
selected
=
valid
=
true
;
return
false
;
}
});
// Found a match, nothing to do
if
(
valid
)
{
return
;
}
// Remove invalid value
this
.
input
.
val
(
""
)
.
attr
(
"
title
"
,
value
+
"
didn't match any item
"
)
.
tooltip
(
"
open
"
);
this
.
element
.
val
(
""
);
this
.
_delay
(
function
()
{
this
.
input
.
tooltip
(
"
close
"
).
attr
(
"
title
"
,
""
);
},
2500
);
this
.
input
.
autocomplete
(
"
instance
"
).
term
=
""
;
},
_destroy
:
function
()
{
this
.
wrapper
.
remove
();
this
.
element
.
show
();
}
});
})(
jQuery
);
iperf/iperf-x.js
View file @
7013a13a
...
...
@@ -12,6 +12,7 @@ function debug_log ( msg){
}
}
//--------------------------------------------------------------------------------
function
make_table
(
mtr_rows
){
...
...
@@ -125,6 +126,7 @@ function make_select( elm, url){
html
+=
'
action="javascript:iperf( $(
\'
#tr_host
\'
).val(), $(
\'
#tr_times
\'
).val(), $(
\'
#tr_interval
\'
).val() )">
'
;
html
+=
'
<input class="btn btn-primary btn-lg" type="submit" value="Test" class=button/> to
'
;
html
+=
'
<input id=tr_host value="" placeholder="my host" title="Automatisk utfylling av målepålenavn"></input>
'
;
html
+=
'
<button id="toggle">Show menu</button>
'
;
html
+=
'
for <input id=tr_times value=3 style="width:3em;text-align:right"> seconds</input>
'
;
// html+=', using <input id=tr_size value=64 style="width:3em;text-align:right"> bytes packets</input>';
html
+=
'
, report every <input id=tr_interval value=1 style="width:3em;text-align:right"> seconds.
'
;
...
...
@@ -152,7 +154,11 @@ html+= 'action="javascript:iperf( $(\'#tr_host\').val(), $(\'#tr_times\').val(),
});
// html+='</select>';
// $(elm).html(html+'</select></form>');
$
(
"
#tr_host
"
).
autocomplete
({
source
:
items
});
// $( "#tr_host" ).autocomplete({ source: items });
$
(
"
#tr_host
"
).
combobox
({
source
:
items
});
$
(
"
#toggle
"
).
click
(
function
()
{
$
(
"
#combobox
"
).
toggle
();
});
});
request
.
fail
(
function
(
jqXHR
,
status
,
error
){
console
.
log
(
'
Listing beacons faild from
'
+
url
+
'
:
'
+
status
+
'
,
'
+
error
);
...
...
@@ -252,3 +258,116 @@ $(document).ready( function(){
});
(
function
(
$
)
{
$
.
widget
(
"
custom.combobox
"
,
{
_create
:
function
()
{
this
.
wrapper
=
$
(
"
<span>
"
)
.
addClass
(
"
custom-combobox
"
)
.
insertAfter
(
this
.
element
);
this
.
element
.
hide
();
this
.
_createAutocomplete
();
this
.
_createShowAllButton
();
},
_createAutocomplete
:
function
()
{
var
selected
=
this
.
element
.
children
(
"
:selected
"
),
value
=
selected
.
val
()
?
selected
.
text
()
:
""
;
this
.
input
=
$
(
"
<input>
"
)
.
appendTo
(
this
.
wrapper
)
.
val
(
value
)
.
attr
(
"
title
"
,
""
)
.
addClass
(
"
custom-combobox-input ui-widget ui-widget-content ui-state-default ui-corner-left
"
)
.
autocomplete
({
delay
:
0
,
minLength
:
0
,
source
:
$
.
proxy
(
this
,
"
_source
"
)
})
.
tooltip
({
tooltipClass
:
"
ui-state-highlight
"
});
this
.
_on
(
this
.
input
,
{
autocompleteselect
:
function
(
event
,
ui
)
{
ui
.
item
.
option
.
selected
=
true
;
this
.
_trigger
(
"
select
"
,
event
,
{
item
:
ui
.
item
.
option
});
},
autocompletechange
:
"
_removeIfInvalid
"
});
},
_createShowAllButton
:
function
()
{
var
input
=
this
.
input
,
wasOpen
=
false
;
$
(
"
<a>
"
)
.
attr
(
"
tabIndex
"
,
-
1
)
.
attr
(
"
title
"
,
"
Show All Items
"
)
.
tooltip
()
.
appendTo
(
this
.
wrapper
)
.
button
({
icons
:
{
primary
:
"
ui-icon-triangle-1-s
"
},
text
:
false
})
.
removeClass
(
"
ui-corner-all
"
)
.
addClass
(
"
custom-combobox-toggle ui-corner-right
"
)
.
mousedown
(
function
()
{
wasOpen
=
input
.
autocomplete
(
"
widget
"
).
is
(
"
:visible
"
);
})
.
click
(
function
()
{
input
.
focus
();
// Close if already visible
if
(
wasOpen
)
{
return
;
}
// Pass empty string as value to search for, displaying all results
input
.
autocomplete
(
"
search
"
,
""
);
});
},
_source
:
function
(
request
,
response
)
{
var
matcher
=
new
RegExp
(
$
.
ui
.
autocomplete
.
escapeRegex
(
request
.
term
),
"
i
"
);
response
(
this
.
element
.
children
(
"
option
"
).
map
(
function
()
{
var
text
=
$
(
this
).
text
();
if
(
this
.
value
&&
(
!
request
.
term
||
matcher
.
test
(
text
)
)
)
return
{
label
:
text
,
value
:
text
,
option
:
this
};
})
);
},
_removeIfInvalid
:
function
(
event
,
ui
)
{
// Selected an item, nothing to do
if
(
ui
.
item
)
{
return
;
}
// Search for a match (case-insensitive)
var
value
=
this
.
input
.
val
(),
valueLowerCase
=
value
.
toLowerCase
(),
valid
=
false
;
this
.
element
.
children
(
"
option
"
).
each
(
function
()
{
if
(
$
(
this
).
text
().
toLowerCase
()
===
valueLowerCase
)
{
this
.
selected
=
valid
=
true
;
return
false
;
}
});
// Found a match, nothing to do
if
(
valid
)
{
return
;
}
// Remove invalid value
this
.
input
.
val
(
""
)
.
attr
(
"
title
"
,
value
+
"
didn't match any item
"
)
.
tooltip
(
"
open
"
);
this
.
element
.
val
(
""
);
this
.
_delay
(
function
()
{
this
.
input
.
tooltip
(
"
close
"
).
attr
(
"
title
"
,
""
);
},
2500
);
this
.
input
.
autocomplete
(
"
instance
"
).
term
=
""
;
},
_destroy
:
function
()
{
this
.
wrapper
.
remove
();
this
.
element
.
show
();
}
});
})(
jQuery
);
\ No newline at end of file
mp-web-bs.html
View file @
7013a13a
...
...
@@ -16,11 +16,11 @@ Se mer om <a class="btn btn-default" href="http://www.uninett.no/malepale">mål
<div
class=
"col-lg-12 gutter uninett-padded uninett-color-lightBlue"
>
<h3>
Tjenester mot denne målepålen
</h3>
<p><a
class=
"btn btn-primary btn-lg"
href=
"
base
/rute/"
>
Rute
</a>
viser ruten trafikken tar fra målepålen mot deg.
<p><a
class=
"btn btn-primary btn-lg"
href=
"
base
/yt/"
>
Yt
</a>
måler hvor fort du kan overføre data mellom deg og målepålen. Enkel og brukervennlig.
<p><a
class=
"btn btn-primary btn-lg"
href=
"
base
/iperf/"
>
Iperf
</a>
måler ytelsen fra målepålen mot en annen målepåle eller maskin med Iperf.
</p>
<p><a
class=
"btn btn-primary btn-lg"
href=
"
/mp-web
/rute/"
>
Rute
</a>
viser ruten trafikken tar fra målepålen mot deg.
<p><a
class=
"btn btn-primary btn-lg"
href=
"
/mp-web
/yt/"
>
Yt
</a>
måler hvor fort du kan overføre data mellom deg og målepålen. Enkel og brukervennlig.
<p><a
class=
"btn btn-primary btn-lg"
href=
"
/mp-web
/iperf/"
>
Iperf
</a>
måler ytelsen fra målepålen mot en annen målepåle eller maskin med Iperf.
</p>
<!-- ok discontinued due to bad TCP
<p><a href="
base
/ndt/">NDT</a> (Network Diagnostic Tool) måler ytelsen fra din klient mot målepålen - Er mer teknisk. </p>
<p><a href="
/mp-web
/ndt/">NDT</a> (Network Diagnostic Tool) måler ytelsen fra din klient mot målepålen - Er mer teknisk. </p>
-->
<!--
...
...
mp-web-main-js.html
View file @
7013a13a
...
...
@@ -5,7 +5,7 @@
<script
type=
"text/javascript"
src=
"/js/jquery-ui-1.10.3/jquery-1.9.1.js"
></script>
<script
type=
"text/javascript"
src=
"/js/jquery-ui-1.10.3/ui/jquery-ui.js"
></script>
<style
type=
"text/css"
title=
"currentStyle"
>
@import
"/js/jquery-ui-1.10.3/themes/
base
/jquery-ui.css"
;
@import
"/js/jquery-ui-1.10.3/themes/
/mp-web
/jquery-ui.css"
;
</style>
</head>
...
...
mp-web-main-js.php
View file @
7013a13a
<!DOCTYPE html>
<html
lang=
"no"
>
<head>
<?php
include
'
base/
head-bs.html'
?>
<?php
include
'head-bs.html'
?>
<style
type=
"text/css"
title=
"currentStyle"
>
@import
"
base
/js/jquery-ui-1.10.3/themes/base/jquery-ui.css"
;
@import
"
/mp-web
/js/jquery-ui-1.10.3/themes/base/jquery-ui.css"
;
</style>
<script
type=
"text/javascript"
src=
"
base
/js/jquery-ui-1.10.3/ui/jquery-ui.js"
></script>
<link
href=
"
base
/js/select2/select2.css"
rel=
"stylesheet"
/>
<script
type=
"text/javascript"
src=
"
base
/js/select2/select2.js"
></script>
<script
type=
"text/javascript"
src=
"
base
/js/mp-select.js"
></script>
<script
type=
"text/javascript"
src=
"
/mp-web
/js/jquery-ui-1.10.3/ui/jquery-ui.js"
></script>
<link
href=
"
/mp-web
/js/select2/select2.css"
rel=
"stylesheet"
/>
<script
type=
"text/javascript"
src=
"
/mp-web
/js/select2/select2.js"
></script>
<script
type=
"text/javascript"
src=
"
/mp-web
/js/mp-select.js"
></script>
</head>
<body>
<?php
include
'body-bs.html'
?>
<script>
$
(
"
#title-bs
"
).
html
(
'
<a href="https://www.uninett.no/malepale-detaljer">Mleple</a>
'
);
// title
$
(
'
#top-menu-bs
'
).
load
(
"
base
/top-menu-bs.html
"
);
$
(
'
#top-menu-bs
'
).
load
(
"
/mp-web
/top-menu-bs.html
"
);
$
(
'
#body-bs
'
).
load
(
"
mp-web-bs.html
"
);
// main body content
</script>
...
...
top-menu-bs.html
View file @
7013a13a
<ul
id=
"top-menu-ul"
class=
'nav navbar-nav'
>
<li>
<a
href=
"
base
/"
>
Oversikt
</a></li>
<li><a
href=
"
base
/yt/"
>
Yt
</a></li>
<li><a
href=
"
base
/rute/"
>
Rute
</a></li>
<li><a
href=
"
base
/iperf/"
>
Iperf
</a>
<li>
<a
href=
"
/mp-web
/"
>
Oversikt
</a></li>
<li><a
href=
"
/mp-web
/yt/"
>
Yt
</a></li>
<li><a
href=
"
/mp-web
/rute/"
>
Rute
</a></li>
<li><a
href=
"
/mp-web
/iperf/"
>
Iperf
</a>
<!-- ndt discontinued due kernel tcp problems
<li><a href="/ndt/">NDT</a></li>
-->
<li><a
href=
"http://mping.uninett.no/"
>
MPing
</a></li>
<li><a
href=
"http://testnett.uninett.no/matrix/"
>
Multicast beacon
</a></li>
<!--
<li><a href="
base
/matrix/>Multicast beacon</a>"</li>
<li><a href="
base
/appmon">AppMon</a></li>
<li><a href="
/mp-web
/matrix/>Multicast beacon</a>"</li>
<li><a href="
/mp-web
/appmon">AppMon</a></li>
<li><a href=http://uninett.no><img src="/images/UNINETT_logo_t.png" alt="uninettlogo" /></a>
-->
</ul>
yt/jsbandwidth-body.html
View file @
7013a13a
...
...
@@ -89,6 +89,7 @@ at about <td><form name="speedtest" id="speedform">
<span
id=
response
></span>
<div
id=
trend
style=
width:100%
></div>
<div
id=
graf
style=
width:100%
></div>
<!--
...
...
yt/jsbandwidth.js
View file @
7013a13a
...
...
@@ -27,7 +27,7 @@ var upload; // object for starting upload
//var ulspeedsum=0, uldiffsum=0, ulbytesum=0, ulno=0;
//var dlspeedsum=0, dldiffsum=0, dlbytesum=0, dlno=0 ;
var
dl
avg
=
0
,
ulavg
=
0
;
var
dl
sum
=
0
,
ulsum
=
0
;
var
dlseriesavg
;
var
ulseriesavg
;
// data series for curves
var
dldiffs
=
[],
uldiffs
=
[];
var
dlspeeds
=
[],
ulspeeds
=
[];
...
...
@@ -48,7 +48,9 @@ var downcolor='#00612b';
var
colors
=
{
'
up
'
:
upcolor
,
'
down
'
:
downcolor
};
//var series=[{ 'name':'Download', data:[], type: 'scatter' , color: downcolor },
// { 'name':'Upload', data:[], type: 'scatter' , color: upcolor }];
var
chart
;
var
chart
;
var
trend_chart
,
trend_series
=
[],
trend_data
=
[];
var
trend_name
=
{
"
up
"
:
"
Upload trend
"
,
"
down
"
:
"
Download trend
"
}
$
(
document
).
ready
(
function
()
{
...
...
@@ -71,7 +73,7 @@ function test_performance(dir){
TestRoundTrip
();
if
(
!
chart
){
// creat new chart
chart
=
tegn_graf
(
'
graf
'
,
'
Bandwidth
graph
'
,
'
With
'
+
document
.
location
.
hostname
,
[],
''
,
0
);
chart
=
tegn_graf
(
'
graf
'
,
'
Bandwidth
detail
'
,
'
With
'
+
document
.
location
.
hostname
,
[],
''
,
0
,
'
linear
'
);
}
...
...
@@ -177,11 +179,12 @@ function get_progress(e, probj) { // to be called onprogress in ajax
temp_span
[
probj
.
dir
]
=
new
stats
();
var
str
=
probj
.
dir
;
str
=
str
.
substring
(
0
,
1
).
toUpperCase
()
+
str
.
substring
(
1
,
str
.
length
);
// capitalize
temp_series
[
probj
.
dir
]
=
chart
.
addSeries
(
{
'
name
'
:
str
+
'
load
'
+
'
..
'
,
data
:[],
type
:
'
scatter
'
,
color
:
colors
[
probj
.
dir
]
});
temp_series
[
probj
.
dir
]
=
chart
.
addSeries
(
{
'
name
'
:
str
+
'
load
'
+
'
..
'
,
data
:[],
type
:
'
scatter
'
,
color
:
colors
[
probj
.
dir
]
});
}
temp_speed
[
probj
.
dir
].
add
(
mbps
);
temp_span
[
probj
.
dir
].
add
(
span
);
if
(
temp_speed
[
probj
.
dir
].
n
%
noparallels
[
probj
.
runno
]
==
0
){
// temp_series[probj.dir].addPoint([probj.begin+temp_span[probj.dir].average(),
temp_series
[
probj
.
dir
].
addPoint
([
temp_span
[
probj
.
dir
].
average
()
/
1000
,
temp_speed
[
probj
.
dir
].
sum
]);
temp_speed
[
probj
.
dir
]
=
new
stats
();
...
...
@@ -409,6 +412,7 @@ function TestUpload(runno, id, speedclass, testbytes, duration) {
timeout
:
test_period
,
error
:
function
(
xhr
,
textStatus
,
errorThrown
){
if
(
textStatus
===
'
timeout
'
){
probj
.
done
=
true
;
upload_complete
(
probj
.
loaded
,
probj
);
console
.
log
(
'
timeout bytes
'
+
probj
.
loaded
);
}
else
{
...
...
@@ -429,7 +433,7 @@ function TestUpload(runno, id, speedclass, testbytes, duration) {
uldiffs
.
push
(
probj
.
uldiff
);
console
.
log
(
'
complete
'
+
probj
.
dir
+
'
id
'
+
probj
.
id
+
'
tid
'
+
probj
.
uldiff
+
'
'
+
bytes
+
'
bytes
'
);
if
(
(
speedclass
+
1
)
>=
(
sizesk
.
length
)
){
if
(
(
speedclass
+
1
)
>=
(
sizesk
.
length
)
||
probj
.
done
){
sumup
(
probj
);
console
.
log
(
'
Too large file needed
'
+
'
class
'
+
speedclass
+
'
up time
'
+
probj
.
dldiff
+
'
bytes
'
+
probj
.
total
);
...
...
@@ -438,6 +442,7 @@ function TestUpload(runno, id, speedclass, testbytes, duration) {
if
(
probj
.
uldiff
<
duration
*
0.80
){
// project size to give max_length
var
test_size
=
Math
.
min
(
max_test_size
,
probj
.
bytes
/
probj
.
uldiff
*
duration
);
probj
.
done
=
true
;
TestUpload
(
runno
,
id
,
speedclass
+
1
,
test_size
,
duration
);
console
.
log
(
'
last shot class
'
+
(
speedclass
+
1
)
+
'
sizek
'
+
test_size
.
toFixed
(
1
)
);
}
else
{
// done
...
...
@@ -506,18 +511,22 @@ function sumdown(probj){
console
.
log
(
'
histo
'
+
Math
.
round
(
runspeed
*
pixsz
)
+
'
px
'
+
Math
.
round
(
average_sum
(
ps
.
speed
)
*
pixsz
)
+
'
px
'
+
thruwidth
);
// length of line will indicate max test period
if
(
ps
.
speed
[
run
].
n
>=
noparallels
[
run
]
){
// var dldata= [ [0, dlavg], [Math.max.apply(Math, dldiffs), dlavg] ];
var
dldata
=
[
[
0
,
ps
.
speed
[
run
].
sum
],
[
Math
.
max
.
apply
(
Math
,
dldiffs
),
ps
.
speed
[
run
].
sum
]
];
if
(
dlseriesavg
){
dlseriesavg
.
update
({
data
:
dldata
});
}
else
{
dlseriesavg
=
chart
.
addSeries
({
name
:
'
Download avg
'
,
data
:
dldata
,
color
:
downcolor
},
true
);
}
// chart.yAxis[0].update( { min: 0, max: 2*
// var dldata= [ [probj.begin, ps.speed[run].sum], [probj.begin+Math.max.apply(Math, dldiffs)*1000, ps.speed[run].sum] ];
var
dldata
=
[
[
0
,
ps
.
speed
[
run
].
sum
],
[
Math
.
max
.
apply
(
Math
,
dldiffs
),
ps
.
speed
[
run
].
sum
]
];
dlsum
=
ps
.
speed
[
run
].
sum
;
if
(
dlseriesavg
){
dlseriesavg
.
update
({
data
:
dldata
});
}
else
{
dlseriesavg
=
chart
.
addSeries
({
name
:
'
Download avg
'
,
data
:
dldata
,
color
:
downcolor
},
true
);
}
chart
.
yAxis
[
0
].
update
(
{
min
:
0
,
max
:
2
*
Math
.
max
(
dlsum
,
ulsum
)
}
);
// Math.max(average_all(perf_stat.down.speed), average_all(perf_stat.up.speed) ) });
// Math.max(dlavg, ulavg) } );
update_trend_chart
(
probj
.
dir
,
probj
.
begin
,
ps
.
speed
[
run
].
sum
);
}
ResultsUpload
(
"
download
"
,
runspeed
,
rtt
,
probj
.
start
);
}
...
...
@@ -573,22 +582,45 @@ function sumup(probj){
$
(
'
#ulbaravg
'
).
css
(
'
width
'
,
Math
.
round
(
average_sum
(
ps
.
speed
)
*
pixsz
)
+
'
px
'
);
console
.
log
(
"
tablewidth
"
+
tablewidth
+
"
what
"
+
$
(
"
#what
"
).
width
()
+
"
#ulspeed
"
+
$
(
'
#ulspeed
'
).
width
()
+
"
uldiff
"
+
$
(
'
#uldiff
'
).
width
()
+
"
thruwidth
"
+
thruwidth
+
"
refv
"
+
refv
);
if
(
ps
.
speed
[
run
].
n
>=
noparallels
[
run
]
){
// var uldata= [ [0, ulavg], [Math.max.apply(Math, uldiffs), ulavg] ];
var
uldata
=
[
[
0
,
ps
.
speed
[
run
].
sum
],
[
Math
.
max
.
apply
(
Math
,
uldiffs
),
ps
.
speed
[
run
].
sum
]
];
if
(
ulseriesavg
){
ulseriesavg
.
update
({
data
:
uldata
});
}
else
{
ulseriesavg
=
chart
.
addSeries
({
name
:
'
Upload avg
'
,
data
:
uldata
,
color
:
upcolor
},
true
);
// var uldata= [ [probj.begin, ps.speed[run].sum], [probj.begin+Math.max.apply(Math, uldiffs)*1000, ps.speed[run].sum] ];
var
uldata
=
[
[
0
,
ps
.
speed
[
run
].
sum
],
[
Math
.
max
.
apply
(
Math
,
uldiffs
),
ps
.
speed
[
run
].
sum
]
];
ulsum
=
ps
.
speed
[
run
].
sum
;
if
(
ulseriesavg
){
ulseriesavg
.
update
({
data
:
uldata
});
}
else
{
ulseriesavg
=
chart
.
addSeries
({
name
:
'
Upload avg
'
,
data
:
uldata
,
color
:
upcolor
},
true
);
}
chart
.
yAxis
[
0
].
update
(
{
min
:
0
,
max
:
2
*
Math
.
max
(
dlsum
,
ulsum
)
}
);
// Math.max(average_all(perf_stat.down.speed), average_all(perf_stat.up.speed) ) });
update_trend_chart
(
probj
.
dir
,
probj
.
begin
,
ps
.
speed
[
run
].
sum
);
}
// chart.yAxis[0].update( { min: 0, max: 2*
// Math.max(average_all(perf_stat.down.speed), average_all(perf_stat.up.speed) ) });
ResultsUpload
(
"
upload
"
,
runspeed
,
rtt
,
probj
.
start
);
}
function
update_trend_chart
(
dir
,
begin
,
speed
){
// trend_chart=chart;
//return 0;
console
.
log
(
"
trend
"
+
dir
+
"
begin
"
+
begin
+
"
speed
"
+
speed
);
if
(
!
trend_data
[
dir
]){
trend_data
[
dir
]
=
[];
}
trend_data
[
dir
].
push
([
begin
,
speed
]);
if
(
trend_data
[
dir
].
length
>
1
){
if
(
!
trend_chart
){
trend_chart
=
tegn_graf
(
'
trend
'
,
'
Bandwidth trend
'
,
'
With
'
+
document
.
location
.
hostname
,
[],
''
,
0
,
'
datetime
'
);
}
if
(
!
trend_series
[
dir
]){
trend_series
[
dir
]
=
trend_chart
.
addSeries
({
name
:
trend_name
[
dir
],
data
:
trend_data
[
dir
],
color
:
colors
[
dir
]
},
true
);
}
trend_series
[
dir
].
update
({
data
:
trend_data
[
dir
]});
}
}
function
TestRoundTrip
(){
var
ts
,
img
=
new
Image
;
img
.
onload
=
function
(){
...
...
@@ -636,7 +668,7 @@ function make_bits(bits){
//------------------------------------------------------------------------------