#!/usr/bin/perl -w
#
#  $Id: raptor_httpstats,v 1.1 2002/06/11 14:30:26 dgregor Exp $
#

while (<>) {
	m/user=/ || next;

	if (m/proto=http-https/) {
		${http_https}++;
	} elsif (m/proto=http-ftp/) {
		${http_ftp}++;
	} elsif (m/proto=http/) {
		$http++;
	}
}

printf "http: %d (%2.2f%%)\n",
	$http,
	( ($http / ($http + ${http_https} + ${http_ftp}) ) * 100 );

printf "http-https: %d (%2.2f%%)\n",
	${http_https},
	( (${http_https} / ($http + ${http_https} + ${http_ftp}) ) * 100 );

printf "http-ftp: %d (%2.2f%%)\n",
	${http_ftp},
	( (${http_ftp} / ($http + ${http_https} + ${http_ftp}) ) * 100 );

