$Cap{$slice} = "sent";
bw_cap_mail($slice);
if (! $debug) {
- log_bandwidth_cap($slice, $bwcap_default);
- cap_bandwidth($slice, $bwcap_default);
+ log_bandwidth_cap($slice, $Maxrate{$slice});
+ cap_bandwidth($slice, $Maxrate{$slice});
}
}
} else {
my ($slicename) = @_;
my $hostname = hostname();
my $date = get_date();
- my $sent = int($Cutoff{$slicename}/1000000000);
+ my $sent = int($Cutoff{$slicename}/(1024*1024));
my $bwcap = $Maxrate{$slicename};
send_mail("$alias_addr, $slicename\@slices.planet-lab.org",
"$proc capped bandwidth of slice $slicename on $hostname",
- "Slice $slicename has transmitted more than ${sent}GB today".
+ "Slice $slicename has transmitted more than ${sent}MB today".
" on $hostname. ".
"Its bandwidth will be capped at $bwcap until midnight GMT.".
"\n\n$date $hostname bwcap $slicename\n");