Examples/HttpAnalyzer/main.cpp
/**
 * Print a summary of all statistics collected by the HttpStatsCollector. Should be called when traffic capture was finished
 */
Print a summary of all statistics collected by the HttpStatsCollector. Should be called when traffic capture was finished
Print a summary of all statistics collected by the HttpStatsCollector . Should be called when traffic capture was finished
void printStatsSummary(HttpStatsCollector& collector)
{
	printStatsHeadline("General stats");
	PRINT_STAT_LINE("Sample time", collector.getGeneralStats().sampleTime, "Seconds");
	PRINT_STAT_LINE("Number of HTTP packets", collector.getGeneralStats().numOfHttpPackets, "Packets");
	PRINT_STAT_LINE("Rate of HTTP packets", collector.getGeneralStats().httpPacketRate.totalRate, "Packets/sec");
	PRINT_STAT_LINE("Number of HTTP flows", collector.getGeneralStats().numOfHttpFlows, "Flows");
	PRINT_STAT_LINE("Rate of HTTP flows", collector.getGeneralStats().httpFlowRate.totalRate, "Flows/sec");
	PRINT_STAT_LINE("Number of HTTP pipelining flows", collector.getGeneralStats().numOfHttpPipeliningFlows, "Flows");
	PRINT_STAT_LINE("Number of HTTP transactions", collector.getGeneralStats().numOfHttpTransactions, "Transactions");
	PRINT_STAT_LINE("Rate of HTTP transactions", collector.getGeneralStats().httpTransactionsRate.totalRate, "Transactions/sec");
	PRINT_STAT_LINE("Total HTTP data", collector.getGeneralStats().amountOfHttpTraffic, "Bytes");
	PRINT_STAT_LINE("Rate of HTTP data", collector.getGeneralStats().httpTrafficRate.totalRate, "Bytes/sec");
	PRINT_STAT_LINE("Average packets per flow", collector.getGeneralStats().averageNumOfPacketsPerFlow, "Packets");
	PRINT_STAT_LINE("Average transactions per flow", collector.getGeneralStats().averageNumOfHttpTransactionsPerFlow, "Transactions");
	PRINT_STAT_LINE("Average data per flow", collector.getGeneralStats().averageAmountOfDataPerFlow, "Bytes");
	printStatsHeadline("HTTP request stats");
	PRINT_STAT_LINE("Number of HTTP requests", collector.getRequestStats().numOfMessages, "Requests");
	PRINT_STAT_LINE("Rate of HTTP requests", collector.getRequestStats().messageRate.totalRate, "Requests/sec");
	PRINT_STAT_LINE("Total data in headers", collector.getRequestStats().totalMessageHeaderSize, "Bytes");
	PRINT_STAT_LINE("Average header size", collector.getRequestStats().averageMessageHeaderSize, "Bytes");
	printStatsHeadline("HTTP response stats");
	PRINT_STAT_LINE("Number of HTTP responses", collector.getResponseStats().numOfMessages, "Responses");
	PRINT_STAT_LINE("Rate of HTTP responses", collector.getResponseStats().messageRate.totalRate, "Responses/sec");
	PRINT_STAT_LINE("Total data in headers", collector.getResponseStats().totalMessageHeaderSize, "Bytes");
	PRINT_STAT_LINE("Average header size", collector.getResponseStats().averageMessageHeaderSize, "Bytes");
	PRINT_STAT_LINE("Num of responses with content-length", collector.getResponseStats().numOfMessagesWithContentLength, "Responses");
	PRINT_STAT_LINE("Total body size (may be compressed)", collector.getResponseStats().totalConentLengthSize, "Bytes");
	PRINT_STAT_LINE("Average body size", collector.getResponseStats().averageContentLengthSize, "Bytes");
	printStatsHeadline("HTTP request methods");
	printMethods(collector.getRequestStats());
	printStatsHeadline("Hostnames count");
	printHostnames(collector.getRequestStats());
	printStatsHeadline("Status code count");
	printStatusCodes(collector.getResponseStats());
	printStatsHeadline("Content-type count");
	printContentTypes(collector.getResponseStats());
}
void printStatsSummary ( HttpStatsCollector & collector ) { printStatsHeadline ( " " ) ; PRINT_STAT_LINE ( " " , collector . getGeneralStats ( ) . sampleTime , " " ) ; PRINT_STAT_LINE ( " " , collector . getGeneralStats ( ) . numOfHttpPackets , " " ) ; PRINT_STAT_LINE ( " " , collector . getGeneralStats ( ) . httpPacketRate . totalRate , " " ) ; PRINT_STAT_LINE ( " " , collector . getGeneralStats ( ) . numOfHttpFlows , " " ) ; PRINT_STAT_LINE ( " " , collector . getGeneralStats ( ) . httpFlowRate . totalRate , " " ) ; PRINT_STAT_LINE ( " " , collector . getGeneralStats ( ) . numOfHttpPipeliningFlows , " " ) ; PRINT_STAT_LINE ( " " , collector . getGeneralStats ( ) . numOfHttpTransactions , " " ) ; PRINT_STAT_LINE ( " " , collector . getGeneralStats ( ) . httpTransactionsRate . totalRate , " " ) ; PRINT_STAT_LINE ( " " , collector . getGeneralStats ( ) . amountOfHttpTraffic , " " ) ; PRINT_STAT_LINE ( " " , collector . getGeneralStats ( ) . httpTrafficRate . totalRate , " " ) ; PRINT_STAT_LINE ( " " , collector . getGeneralStats ( ) . averageNumOfPacketsPerFlow , " " ) ; PRINT_STAT_LINE ( " " , collector . getGeneralStats ( ) . averageNumOfHttpTransactionsPerFlow , " " ) ; PRINT_STAT_LINE ( " " , collector . getGeneralStats ( ) . averageAmountOfDataPerFlow , " " ) ; printStatsHeadline ( " " ) ; PRINT_STAT_LINE ( " " , collector . getRequestStats ( ) . numOfMessages , " " ) ; PRINT_STAT_LINE ( " " , collector . getRequestStats ( ) . messageRate . totalRate , " " ) ; PRINT_STAT_LINE ( " " , collector . getRequestStats ( ) . totalMessageHeaderSize , " " ) ; PRINT_STAT_LINE ( " " , collector . getRequestStats ( ) . averageMessageHeaderSize , " " ) ; printStatsHeadline ( " " ) ; PRINT_STAT_LINE ( " " , collector . getResponseStats ( ) . numOfMessages , " " ) ; PRINT_STAT_LINE ( " " , collector . getResponseStats ( ) . messageRate . totalRate , " " ) ; PRINT_STAT_LINE ( " " , collector . getResponseStats ( ) . totalMessageHeaderSize , " " ) ; PRINT_STAT_LINE ( " " , collector . getResponseStats ( ) . averageMessageHeaderSize , " " ) ; PRINT_STAT_LINE ( " " , collector . getResponseStats ( ) . numOfMessagesWithContentLength , " " ) ; PRINT_STAT_LINE ( " " , collector . getResponseStats ( ) . totalConentLengthSize , " " ) ; PRINT_STAT_LINE ( " " , collector . getResponseStats ( ) . averageContentLengthSize , " " ) ; printStatsHeadline ( " " ) ; printMethods ( collector . getRequestStats ( ) ) ; printStatsHeadline ( " " ) ; printHostnames ( collector . getRequestStats ( ) ) ; printStatsHeadline ( " " ) ; printStatusCodes ( collector . getResponseStats ( ) ) ; printStatsHeadline ( " " ) ; printContentTypes ( collector . getResponseStats ( ) ) ; }
Print a summary of all statistics collected by the HttpStatsCollector.
Print a summary of all statistics collected by the HttpStatsCollector .