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
b376ba22
Commit
b376ba22
authored
Sep 07, 2010
by
Kevin Atkinson
Browse files
Allow different start time for individual node classes.
parent
b80ba9b4
Changes
1
Show whitespace changes
Inline
Side-by-side
node_usage/analy.in
View file @
b376ba22
...
...
@@ -26,6 +26,15 @@ my $start = ceil($START / $interval) * $interval;
my
@idxs
=
(
0
..
$#to_plot
);
my
@start
;
foreach
(
@idxs
)
{
if
(
defined
$to_plot
[
$_
][
2
])
{
$start
[
$_
]
=
ceil
(
$to_plot
[
$_
][
2
]
/
$interval
)
*
$interval
;
}
else
{
$start
[
$_
]
=
$start
;
}
}
my
$prev_time
=
0
;
my
@prev_data
=
map
{
0
}
@idxs
;
my
@total_so_far
=
map
{
0
}
@idxs
;
...
...
@@ -52,6 +61,11 @@ sub sum_usage_stats ($) {
return
@res
;
}
sub
filter_w_start
($@)
{
my
$time
=
shift
@_
;
return
map
{
$time
>=
$start
[
$_
]
?
$_
[
$_
]
:
'
NaN
'}
@idxs
;
}
while
(
<
F
>
)
{
chop
;
s/^(\d+) (\d+) //
or
die
;
...
...
@@ -99,6 +113,8 @@ while (<F>) {
}
my
@alloc
=
map
{
$num
[
$_
]
-
$free
[
$_
]}
@idxs
;
my
$dtime
=
$next_cutoff
-
$interval
;
@free
=
filter_w_start
$dtime
,
@free
;
@alloc
=
filter_w_start
$dtime
,
@alloc
;
print
O
join
('
',
$dtime
,
map
{
sprintf
("
%.1f
",
$_
)}
(
@free
,
@alloc
)),"
\n
"
if
$dtime
>=
$start
;
$error_frac
=
0
;
...
...
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