Move C++ code out of C headers

The additions into the server.h header used C++ language which caused C
programs to fail to compile. Moved the implementation of the EMAverage
class into the private Server class in the server.hh header and exposed it
via functions in the server.h header. Also temporarily moved
almost_equal_server_scores into the public server.hh as there is no
service.hh header.
This commit is contained in:
Markus Mäkelä
2018-09-08 17:32:59 +03:00
parent 4f6990f90d
commit c81173e320
10 changed files with 85 additions and 52 deletions

View File

@ -648,7 +648,7 @@ void RWSplitSession::clientReply(GWBUF* writebuf, DCB* backend_dcb)
ResponseStat& stat = backend->response_stat();
stat.query_ended();
if (stat.is_valid() && (stat.sync_time_reached()
|| backend->server()->response_time->num_samples() == 0))
|| server_response_time_num_samples(backend->server()) == 0))
{
server_add_response_average(backend->server(),
stat.average().secs(),