Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emulab
emulab-devel
Commits
2cb6b386
Commit
2cb6b386
authored
Sep 17, 2003
by
Mike Hibler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change metric to use, max load and min disk space into site vars
parent
e012c5dc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
5 deletions
+30
-5
tbsetup/plab/plabmetrics.in
tbsetup/plab/plabmetrics.in
+30
-5
No files found.
tbsetup/plab/plabmetrics.in
View file @
2cb6b386
...
...
@@ -11,17 +11,36 @@ use XML::Parser;
#
# Load average metric to use
#
my
$LOADMETRIC
=
"
load_fifteen
";
my
$LOADMETRIC
;
if
(
TBSiteVarExists
("
plab/load_metric
"))
{
$LOADMETRIC
=
TBGetSiteVar
("
plab/load_metric
");
if
(
$LOADMETRIC
!~
/^load_(one|five}fifteen)$/
)
{
undef
$LOADMETRIC
;
}
}
if
(
!
defined
(
$LOADMETRIC
))
{
$LOADMETRIC
=
"
load_fifteen
";
}
#
# Load average at which we stop considering a node available
#
my
$MAXLOAD
=
5.0
;
my
$MAXLOAD
=
5.0
;
if
(
TBSiteVarExists
("
plab/max_load
"))
{
$MAXLOAD
=
TBGetSiteVar
("
plab/max_load
");
}
$MAXLOAD
=
0.0
if
$MAXLOAD
<=
0.0
;
$MAXLOAD
=
1000.0
if
$MAXLOAD
>
1000.0
;
#
# Minimum percentage of free space on disk below which we will not allocate
#
my
$MINDISK
=
10.0
;
my
$MINDISK
=
10
;
if
(
TBSiteVarExists
("
plab/min_disk
"))
{
$MINDISK
=
TBGetSiteVar
("
plab/min_disk
");
}
$MINDISK
=
0
if
$MINDISK
<
0
;
$MINDISK
=
100
if
$MINDISK
>
100
;
#
# Drift to allow between our clock and the gmond nodes
...
...
@@ -120,7 +139,9 @@ if (defined($options{"f"})) {
}
}
print
"
\n
=== plabmetrics running at
"
.
`
date
`
print
"
\n
=== plabmetrics
"
.
"
(metric=
$LOADMETRIC
, maxload=
$MAXLOAD
, mindisk=
$MINDISK
)
"
.
"
running at
"
.
`
date
`
if
$debug
;
#
...
...
@@ -237,7 +258,11 @@ sub InsertMetrics()
# Load must be under MAXLOAD, favor those with lower load
#
$load
=
$metrics
{
$LOADMETRIC
};
$scaled
=
$load
/
$MAXLOAD
;
if
(
$MAXLOAD
>
0
)
{
$scaled
=
$load
/
$MAXLOAD
;
}
else
{
$scaled
=
999.0
;
}
#
# Plab people request that we not start jobs on nodes
...
...
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