#!/usr/athena/bin/perl

require '/afs/sipb/user/mkgray/bin/bargraph.pl';
require 'getopts.pl';

sub usage {
    print("bonehead!\n");
}

&usage if ! &Getopts('d');

if($opt_d){
    while(<>){
	($g, $n, $host) = split;
	@hfields = split(/\./, $host);
	$dom = $hfields[$#hfields-1].'.'.$hfields[$#hfields];
	$domain{$dom}+=$n unless $hfields[$#hfields] > 0;
	$total += $n;
    }
    print("MIT: $domain{'mit.edu'}, total: $total\n");
    print &bargraph'draw(values %domain, keys %domain);
}

