www.pudn.com > acdx.rar > HttpServerStats.h


#if !defined(HttpServerStats_H) 
#define HttpServerStats_H 
 
#include "TextFile.h" 
#include "HttpRequest.h" 
 
#include  
using namespace std; 
 
#pragma warning( disable:4800 ) 
 
 
// types of status counters 
enum  
{  
	STATUS_INFORMATIONAL = 0, 
	STATUS_SUCCESS,  
	STATUS_REDIRECTION, 
	STATUS_CLIENTERR,  
	STATUS_SERVERERR, 
	STATUS_NO_COUNTERS 
}; 
 
/////////////////////////////////////////////////////////////////////////////////////// 
// HttpServerStats 
// 
// Purpose:		http server statistics 
 
 
 
//##ModelId=424BB64302D7 
class HttpServerStats 
{ 
protected: 
 
	//##ModelId=424BB64302E6 
	bool			_logging;			// shows if logging results 
	//##ModelId=424BB6430306 
	vector	_stats;				// stats for server by status group 
	//##ModelId=424BB6430315 
	int				_numberOfHits;		// total hits 
	//##ModelId=424BB6430325 
	TextFile		_logFile;			// log file for server stats 
 
public: 
 
	//##ModelId=424BB6430329 
	HttpServerStats (); 
	//##ModelId=424BB6430334 
	virtual ~HttpServerStats (); 
 
	// create release 
	//##ModelId=424BB6430336 
	bool create  (); 
	//##ModelId=424BB6430337 
	void release (); 
 
	// status methods 
	//##ModelId=424BB6430343 
	void    reset			(); 
	//##ModelId=424BB6430344 
	void    hit				( HttpRequest & request ); 
	//##ModelId=424BB6430346 
	void    getStats		( HttpRequest & request ); 
 
	// logging methods 
	//##ModelId=424BB6430354 
	bool getLogging () 
	{ 
		return _logging; 
	} 
 
	//##ModelId=424BB6430355 
	void setLogging ( bool set ) 
	{ 
		_logging = set; 
	} 
 
 
}; 
 
 
#endif