diff --git a/daemon/control_ng.c b/daemon/control_ng.c index c5f55c6b4..e1c375d88 100644 --- a/daemon/control_ng.c +++ b/daemon/control_ng.c @@ -350,15 +350,15 @@ int control_ng_process(str *buf, const endpoint_t *sin, char *addr, // XXX could generalise these, same as above switch (command) { case NGC_OFFER: - atomic64_inc(&rtpe_stats.ax.offers); + RTPE_STATS_INC(offers); timeval_update_request_time(&rtpe_totalstats_interval.offer, &cmd_process_time); break; case NGC_ANSWER: - atomic64_inc(&rtpe_stats.ax.answers); + RTPE_STATS_INC(answers); timeval_update_request_time(&rtpe_totalstats_interval.answer, &cmd_process_time); break; case NGC_DELETE: - atomic64_inc(&rtpe_stats.ax.deletes); + RTPE_STATS_INC(deletes); timeval_update_request_time(&rtpe_totalstats_interval.delete, &cmd_process_time); break; default: diff --git a/t/test-stats.c b/t/test-stats.c index 739eedf95..b51033693 100644 --- a/t/test-stats.c +++ b/t/test-stats.c @@ -367,11 +367,11 @@ int main(void) { "]\n" "}\n"); - atomic64_inc(&rtpe_stats.ax.offers); + RTPE_STATS_INC(offers); struct timeval diff = {2,500000}; timeval_update_request_time(&rtpe_totalstats_interval.offer, &diff); - atomic64_inc(&rtpe_stats.ax.offers); + RTPE_STATS_INC(offers); diff = (struct timeval) {3,200000}; timeval_update_request_time(&rtpe_totalstats_interval.offer, &diff); @@ -669,7 +669,7 @@ int main(void) { "]\n" "}\n"); - atomic64_inc(&rtpe_stats.ax.answers); + RTPE_STATS_INC(answers); diff = (struct timeval) {3,200000}; timeval_update_request_time(&rtpe_totalstats_interval.answer, &diff); @@ -970,17 +970,17 @@ int main(void) { // test cmd_ps_min/max/avg call_timer(NULL); - atomic64_add(&rtpe_stats.ax.offers, 100); + RTPE_STATS_ADD(offers, 100); rtpe_now.tv_sec += 2; - atomic64_add(&rtpe_stats.ax.offers, 20); + RTPE_STATS_ADD(offers, 20); call_timer(NULL); // timer run time interval increased rtpe_now.tv_sec += 5; - atomic64_add(&rtpe_stats.ax.offers, 200); + RTPE_STATS_ADD(offers, 200); call_timer(NULL); graph_str = print_graphite_data(&rtpe_totalstats_lastinterval);