Classes | Public Member Functions | Private Attributes | Friends

metrics Class Reference

#include <metrics.hpp>

Collaboration diagram for metrics:
Collaboration graph
[legend]

List of all members.

Classes

struct  sample

Public Member Functions

 metrics ()
 ~metrics ()
void service_request ()
void no_requests ()
void record_sample (const simple_wml::string_span &name, clock_t parsing_time, clock_t processing_time)
void game_terminated (const std::string &reason)
std::ostream & games (std::ostream &out) const
std::ostream & requests (std::ostream &out) const

Private Attributes

std::vector< samplesamples_
int most_consecutive_requests_
int current_requests_
int nrequests_
int nrequests_waited_
const time_t started_at_
std::map< std::string, int > terminations_

Friends

std::ostream & operator<< (std::ostream &out, metrics &met)

Detailed Description

Definition at line 31 of file metrics.hpp.


Constructor & Destructor Documentation

metrics::metrics (  ) 

Definition at line 42 of file metrics.cpp.

metrics::~metrics (  ) 

Definition at line 52 of file metrics.cpp.

References samples_.


Member Function Documentation

void metrics::game_terminated ( const std::string &  reason  ) 

Definition at line 107 of file metrics.cpp.

References terminations_.

Referenced by server::delete_game().

Here is the caller graph for this function:

std::ostream & metrics::games ( std::ostream &  out  )  const

Definition at line 112 of file metrics.cpp.

References terminations_.

Referenced by server::games_handler().

Here is the caller graph for this function:

void metrics::no_requests (  ) 

Definition at line 76 of file metrics.cpp.

References current_requests_.

Referenced by server::run().

Here is the caller graph for this function:

void metrics::record_sample ( const simple_wml::string_span name,
clock_t  parsing_time,
clock_t  processing_time 
)

Definition at line 81 of file metrics.cpp.

References simple_wml::string_span::duplicate(), lower_bound(), and samples_.

Referenced by server::run().

Here is the call graph for this function:

Here is the caller graph for this function:

std::ostream & metrics::requests ( std::ostream &  out  )  const

Definition at line 127 of file metrics.cpp.

References samples_, and sort().

Referenced by server::requests_handler().

Here is the call graph for this function:

Here is the caller graph for this function:

void metrics::service_request (  ) 

Definition at line 63 of file metrics.cpp.

References current_requests_, most_consecutive_requests_, nrequests_, and nrequests_waited_.

Referenced by server::run().

Here is the caller graph for this function:


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
metrics met 
) [friend]

Definition at line 154 of file metrics.cpp.


Member Data Documentation

Definition at line 76 of file metrics.hpp.

Referenced by no_requests(), and service_request().

Definition at line 75 of file metrics.hpp.

Referenced by operator<<(), and service_request().

int metrics::nrequests_ [private]

Definition at line 77 of file metrics.hpp.

Referenced by operator<<(), and service_request().

Definition at line 78 of file metrics.hpp.

Referenced by operator<<(), and service_request().

std::vector<sample> metrics::samples_ [private]

Definition at line 73 of file metrics.hpp.

Referenced by record_sample(), requests(), and ~metrics().

const time_t metrics::started_at_ [private]

Definition at line 79 of file metrics.hpp.

Referenced by operator<<().

std::map<std::string,int> metrics::terminations_ [private]

Definition at line 80 of file metrics.hpp.

Referenced by game_terminated(), and games().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Thu May 24 2012 01:14:38 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs