Commit c4ef4fdf authored by Mike Hibler's avatar Mike Hibler
Browse files

Clarify (and unify) the units used for xfer rates and sizes.

Some messages said bytes when it is really bits, sizes were actually
Mib/Gib instead of Mb/Gb.
parent f94a6afa
/*
* Copyright (c) 2010-2016 University of Utah and the Flux Group.
* Copyright (c) 2010-2017 University of Utah and the Flux Group.
*
* {{{EMULAB-LICENSE
*
......@@ -56,8 +56,8 @@ struct emulab_configstate {
int image_maxwait; /* sitevar:images/create/maxwait (in min) */
int image_maxiwait; /* sitevar:images/create/idlewait (in min) */
int image_maxrate_dyn; /* sitevar:images/frisbee/maxrate_dynamic */
int image_maxrate_std; /* sitevar:images/frisbee/maxrate_std (in MB/s) */
int image_maxrate_usr; /* sitevar:images/frisbee/maxrate_usr (in MB/s) */
int image_maxrate_std; /* sitevar:images/frisbee/maxrate_std (in Mb/s) */
int image_maxrate_usr; /* sitevar:images/frisbee/maxrate_usr (in Mb/s) */
int image_maxlinger; /* sitevar:images/frisbee/maxlinger (in sec) */
};
......@@ -198,18 +198,18 @@ emulab_read(void)
if (val) {
ival = atoi(val);
/* in GB, allow up to 10TB */
if (ival >= 0 && ival < 10000)
put_maxsize = (uint64_t)ival * 1024 * 1024 * 1024;
if (ival >= 0 && ival <= 10000)
put_maxsize = (uint64_t)ival * 1000 * 1000 * 1000;
free(val);
}
FrisLog(" image_put_maxsize = %d GB",
(int)(put_maxsize/(1024*1024*1024)));
(int)(put_maxsize/(1000*1000*1000)));
val = emulab_getsitevar("images/create/maxwait");
if (val) {
ival = atoi(val);
/* in minutes, allow up to about 10TB @ 10MB/sec */
if (ival >= 0 && ival < 20000)
if (ival >= 0 && ival <= 20000)
put_maxwait = (uint32_t)ival * 60;
free(val);
}
......@@ -220,7 +220,7 @@ emulab_read(void)
if (val) {
ival = atoi(val);
/* in minutes, allow up to about 10TB @ 10MB/sec */
if (ival >= 0 && ival < 20000)
if (ival >= 0 && ival <= 20000)
put_maxiwait = (uint32_t)ival * 60;
free(val);
}
......@@ -240,28 +240,28 @@ emulab_read(void)
if (val) {
ival = atoi(val);
/* in bytes/sec, allow up to 2Gb/sec */
if (ival >= 0 && ival < 2000000000)
if (ival >= 0 && ival <= 2000000000)
get_maxrate_std = (uint32_t)ival;
free(val);
}
if (get_maxrate_dyn)
FrisLog(" image_get_maxrate_std = N/A");
else
FrisLog(" image_get_maxrate_std = %d MB/sec",
FrisLog(" image_get_maxrate_std = %d Mbit/sec",
(int)(get_maxrate_std/1000000));
val = emulab_getsitevar("images/frisbee/maxrate_usr");
if (val) {
ival = atoi(val);
/* in bytes/sec, allow up to 2Gb/sec */
if (ival >= 0 && ival < 2000000000)
if (ival >= 0 && ival <= 2000000000)
get_maxrate_usr = (uint32_t)ival;
free(val);
}
if (get_maxrate_dyn)
FrisLog(" image_get_maxrate_usr = N/A");
else
FrisLog(" image_get_maxrate_usr = %d MB/sec",
FrisLog(" image_get_maxrate_usr = %d Mbit/sec",
(int)(get_maxrate_usr/1000000));
val = emulab_getsitevar("images/frisbee/maxlinger");
......@@ -306,7 +306,7 @@ emulab_restore(void *state)
put_maxsize = cs->image_maxsize;
FrisLog(" image_put_maxsize = %d GB",
(int)(put_maxsize/(1024*1024*1024)));
(int)(put_maxsize/(1000*1000*1000)));
put_maxwait = cs->image_maxwait;
FrisLog(" image_put_maxwait = %d min",
(int)(put_maxwait/60));
......@@ -320,13 +320,13 @@ emulab_restore(void *state)
if (get_maxrate_dyn)
FrisLog(" image_get_maxrate_std = N/A");
else
FrisLog(" image_get_maxrate_std = %d MB/sec",
FrisLog(" image_get_maxrate_std = %d Mbit/sec",
(int)(get_maxrate_std/1000000));
get_maxrate_usr = cs->image_maxrate_usr;
if (get_maxrate_dyn)
FrisLog(" image_get_maxrate_usr = N/A");
else
FrisLog(" image_get_maxrate_usr = %d MB/sec",
FrisLog(" image_get_maxrate_usr = %d Mbit/sec",
(int)(get_maxrate_usr/1000000));
get_maxlinger = cs->image_maxlinger;
if (get_maxlinger == -1)
......
/*
* Copyright (c) 2010-2015 University of Utah and the Flux Group.
* Copyright (c) 2010-2017 University of Utah and the Flux Group.
*
* {{{EMULAB-LICENSE
*
......@@ -87,7 +87,7 @@ null_read(void)
if (dynrate)
FrisLog(" max bandwidth = N/A");
else
FrisLog(" max bandwidth = %d Mb/sec",
FrisLog(" max bandwidth = %d Mbit/sec",
(int)(maxrate/1000000));
if (maxlinger < 0)
......@@ -117,7 +117,7 @@ null_restore(void *state)
if (dynrate)
FrisLog(" max bandwidth = N/A");
else
FrisLog(" max bandwidth = %d MB/sec",
FrisLog(" max bandwidth = %d Mbit/sec",
(int)(maxrate/1000000));
if (maxlinger < 0)
......
/*
* Copyright (c) 2000-2015 University of Utah and the Flux Group.
* Copyright (c) 2000-2017 University of Utah and the Flux Group.
*
* {{{EMULAB-LICENSE
*
......@@ -1485,7 +1485,7 @@ compute_sendrate(void)
if (bandwidth != 0) {
/*
* Convert Mbits/sec to blocks/sec
* Convert bits/sec to blocks/sec
*/
blockspersec = bandwidth / wireblocksize;
......
......@@ -110,8 +110,8 @@ INSERT INTO sitevariables VALUES ('images/create/maxwait',NULL,'72','Max time (m
INSERT INTO sitevariables VALUES ('images/create/idlewait',NULL,'8','Max time (minutes) to allow between periods of progress (image file getting larger) when saving an image (should be <= maxwait)',0);
INSERT INTO sitevariables VALUES ('images/create/maxsize',NULL,'6','Max size (GB) of a created image',0);
INSERT INTO sitevariables VALUES ('general/testbed_shutdown',NULL,'0','Non-zero value indicates that the testbed is shutdown and scripts should not do anything when they run. DO NOT SET THIS BY HAND!',0);
INSERT INTO sitevariables VALUES ('images/frisbee/maxrate_std',NULL,'72000000','Max bandwidth (Bytes/sec) at which to distribute standard images from the /usr/testbed/images directory.',0);
INSERT INTO sitevariables VALUES ('images/frisbee/maxrate_usr',NULL,'54000000','Max bandwidth (Bytes/sec) at which to distribute user-defined images from the /proj/.../images directory.',0);
INSERT INTO sitevariables VALUES ('images/frisbee/maxrate_std',NULL,'72000000','Max bandwidth (Bits/sec) at which to distribute standard images from the /usr/testbed/images directory.',0);
INSERT INTO sitevariables VALUES ('images/frisbee/maxrate_usr',NULL,'54000000','Max bandwidth (Bits/sec) at which to distribute user-defined images from the /proj/.../images directory.',0);
INSERT INTO sitevariables VALUES ('images/frisbee/maxrate_dyn',NULL,'0','If non-zero, use bandwidth throttling on all frisbee servers; maxrate_{std,usr} serve as initial BW values.',0);
INSERT INTO sitevariables VALUES ('images/frisbee/maxlinger',NULL,'180','Seconds to wait after last request before exiting; 0 means never exit, -1 means exit after last client leaves.',0);
INSERT INTO sitevariables VALUES ('general/idlepower_enable',NULL,'0','Enable idle power down to conserve electricity',0);
......
#
# Fix description of frisbee rate variables to correctly reflect
# bits/sec and not bytes/sec.
#
use strict;
use libdb;
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
my $var = "images/frisbee/maxrate_std";
if (TBSiteVarExists($var)) {
my $desc = "Max bandwidth (Bits/sec) at which to distribute ".
"standard images from the /usr/testbed/images directory.";
DBQueryFatal("UPDATE sitevariables SET description='$desc' ".
"WHERE name='$var'");
}
$var = "images/frisbee/maxrate_usr";
if (TBSiteVarExists($var)) {
my $desc = "Max bandwidth (Bits/sec) at which to distribute ".
"user-defined images from the /proj/.../images directory.";
DBQueryFatal("UPDATE sitevariables SET description='$desc' ".
"WHERE name='$var'");
}
return 0;
}
1;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment