Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emulab-devel
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
143
Issues
143
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
emulab
emulab-devel
Commits
194203a8
Commit
194203a8
authored
Jan 28, 2005
by
Mike Hibler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Teach it how to summarize for multiple nodes
parent
f51cd81e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
31 deletions
+29
-31
tbsetup/node_history.in
tbsetup/node_history.in
+29
-31
No files found.
tbsetup/node_history.in
View file @
194203a8
...
...
@@ -146,11 +146,6 @@ if (!$list && !$summary) {
$list
=
1
;
}
if
(
$showall
&&
$summary
)
{
print
STDERR
"
Cannot summarize for all nodes (yet)
\n
";
exit
(
1
)
if
(
!
$list
);
}
#
# Common case: a single node.
# Just fetch data for it, otherwise fetch data for all.
...
...
@@ -302,36 +297,39 @@ for my $rec (@records) {
}
}
print
scalar
(
@records
)
.
"
records
\n
"
if
(
$list
&&
$verbose
);
#
# Print out summary information
# We can do this for all nodes, but how do we present it?
#
my
$node
=
$nodes
[
0
];
# XXX
if
(
$summary
&&
defined
(
$nodestats
{
$node
}))
{
my
(
$ftime
,
$atime
,
$rtime
,
$dtime
)
=
@
{
$nodestats
{
$node
}};
my
$ttime
=
$ftime
+
$atime
+
$rtime
+
$dtime
;
if
(
$verbose
)
{
my
$pct
;
print
"
$node
SUMMARY
\n
";
if
(
$atime
>
0
)
{
$pct
=
(
$atime
*
100
)
/
$ttime
;
printf
("
Allocted: %9d sec (%5.1f%%)
\n
",
$atime
,
$pct
);
}
if
(
$ftime
>
0
)
{
$pct
=
(
$ftime
*
100
)
/
$ttime
;
printf
("
Free: %9d sec (%5.1f%%)
\n
",
$ftime
,
$pct
);
}
if
(
$rtime
>
0
)
{
$pct
=
(
$rtime
*
100
)
/
$ttime
;
printf
("
Reloading: %9d sec (%5.1f%%)
\n
",
$rtime
,
$pct
);
}
if
(
$dtime
>
0
)
{
$pct
=
(
$dtime
*
100
)
/
$ttime
;
printf
("
Down: %9d sec (%5.1f%%)
\n
",
$dtime
,
$pct
);
for
$node
(
sort
keys
(
%nodestats
))
{
if
(
$summary
&&
defined
(
$nodestats
{
$node
}))
{
my
(
$ftime
,
$atime
,
$rtime
,
$dtime
)
=
@
{
$nodestats
{
$node
}};
my
$ttime
=
$ftime
+
$atime
+
$rtime
+
$dtime
;
if
(
$verbose
)
{
my
$pct
;
print
"
$node
SUMMARY
\n
";
if
(
$atime
>
0
)
{
$pct
=
(
$atime
*
100
)
/
$ttime
;
printf
("
Allocted: %9d sec (%5.1f%%)
\n
",
$atime
,
$pct
);
}
if
(
$ftime
>
0
)
{
$pct
=
(
$ftime
*
100
)
/
$ttime
;
printf
("
Free: %9d sec (%5.1f%%)
\n
",
$ftime
,
$pct
);
}
if
(
$rtime
>
0
)
{
$pct
=
(
$rtime
*
100
)
/
$ttime
;
printf
("
Reloading: %9d sec (%5.1f%%)
\n
",
$rtime
,
$pct
);
}
if
(
$dtime
>
0
)
{
$pct
=
(
$dtime
*
100
)
/
$ttime
;
printf
("
Down: %9d sec (%5.1f%%)
\n
",
$dtime
,
$pct
);
}
}
else
{
print
"
$node
SUM
$atime
$ftime
$rtime
$dtime
\n
";
}
}
else
{
print
"
$node
SUM
$atime
$ftime
$rtime
$dtime
\n
";
}
}
...
...
Write
Preview
Markdown
is supported
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