#include <metrics.hpp>
Classes | |
struct | sample |
Public Member Functions | |
metrics () | |
~metrics () | |
void | service_request () |
void | no_requests () |
void | record_sample (const simple_wml::string_span &name, const std::chrono::steady_clock::duration &parsing_time, const std::chrono::steady_clock::duration &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< sample > | samples_ |
int | most_consecutive_requests_ |
int | current_requests_ |
int | nrequests_ |
int | nrequests_waited_ |
const std::chrono::steady_clock::time_point | started_at_ |
std::map< std::string, int > | terminations_ |
Friends | |
std::ostream & | operator<< (std::ostream &out, metrics &met) |
Definition at line 25 of file metrics.hpp.
metrics::metrics | ( | ) |
Definition at line 41 of file metrics.cpp.
metrics::~metrics | ( | ) |
Definition at line 52 of file metrics.cpp.
void metrics::game_terminated | ( | const std::string & | reason | ) |
Definition at line 105 of file metrics.cpp.
References terminations_.
Referenced by wesnothd::server::cleanup_game().
std::ostream & metrics::games | ( | std::ostream & | out | ) | const |
Definition at line 110 of file metrics.cpp.
References n, t, and terminations_.
Referenced by wesnothd::server::games_handler().
void metrics::no_requests | ( | ) |
Definition at line 74 of file metrics.cpp.
References current_requests_.
void metrics::record_sample | ( | const simple_wml::string_span & | name, |
const std::chrono::steady_clock::duration & | parsing_time, | ||
const std::chrono::steady_clock::duration & | processing_time | ||
) |
Use for something?
Definition at line 79 of file metrics.cpp.
References simple_wml::string_span::duplicate(), utf8::index(), metrics::sample::name, and samples_.
std::ostream & metrics::requests | ( | std::ostream & | out | ) | const |
Definition at line 125 of file metrics.cpp.
References n, s, and samples_.
Referenced by wesnothd::server::requests_handler().
void metrics::service_request | ( | ) |
Definition at line 61 of file metrics.cpp.
References current_requests_, most_consecutive_requests_, nrequests_, and nrequests_waited_.
|
friend |
Definition at line 152 of file metrics.cpp.
|
private |
Definition at line 64 of file metrics.hpp.
Referenced by no_requests(), and service_request().
|
private |
Definition at line 63 of file metrics.hpp.
Referenced by service_request().
|
private |
Definition at line 65 of file metrics.hpp.
Referenced by service_request().
|
private |
Definition at line 66 of file metrics.hpp.
Referenced by service_request().
|
private |
Definition at line 61 of file metrics.hpp.
Referenced by record_sample(), requests(), and ~metrics().
|
private |
Definition at line 67 of file metrics.hpp.
|
private |
Definition at line 68 of file metrics.hpp.
Referenced by game_terminated(), and games().