summaryrefslogtreecommitdiffstats
path: root/src/global_statistics.c
diff options
context:
space:
mode:
authorFederico Ceratto <federico.ceratto@gmail.com>2016-11-23 15:49:14 +0000
committerFederico Ceratto <federico.ceratto@gmail.com>2016-11-23 15:49:14 +0000
commit68141d9dac0c08e51d257feef16a79086dd8a2df (patch)
treef4a0f5d31ed2194b5991130754b297b9c8c076e6 /src/global_statistics.c
parentRelease v. 1.3.0+dfsg-1 to Unstable (diff)
parentNew upstream version 1.4.0+dfsg (diff)
downloadnetdata-68141d9dac0c08e51d257feef16a79086dd8a2df.tar.xz
netdata-68141d9dac0c08e51d257feef16a79086dd8a2df.zip
Merge tag 'upstream/1.4.0+dfsg'
Upstream version 1.4.0+dfsg
Diffstat (limited to 'src/global_statistics.c')
-rw-r--r--src/global_statistics.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/global_statistics.c b/src/global_statistics.c
index f39a4cf25..bb2b1f08f 100644
--- a/src/global_statistics.c
+++ b/src/global_statistics.c
@@ -25,7 +25,7 @@ void finished_web_request_statistics(uint64_t dt,
uint64_t bytes_sent,
uint64_t content_size,
uint64_t compressed_content_size) {
-#ifndef NETDATA_NO_ATOMIC_INSTRUCTIONS
+#if defined(HAVE_C___ATOMIC) && !defined(NETDATA_NO_ATOMIC_INSTRUCTIONS)
uint64_t old_web_usec_max = global_statistics.web_usec_max;
while(dt > old_web_usec_max)
__atomic_compare_exchange(&global_statistics.web_usec_max, &old_web_usec_max, &dt, 1, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST);
@@ -57,7 +57,7 @@ void finished_web_request_statistics(uint64_t dt,
}
void web_client_connected(void) {
-#ifndef NETDATA_NO_ATOMIC_INSTRUCTIONS
+#if defined(HAVE_C___ATOMIC) && !defined(NETDATA_NO_ATOMIC_INSTRUCTIONS)
__atomic_fetch_add(&global_statistics.connected_clients, 1, __ATOMIC_SEQ_CST);
#else
if (web_server_mode == WEB_SERVER_MODE_MULTI_THREADED)
@@ -71,7 +71,7 @@ void web_client_connected(void) {
}
void web_client_disconnected(void) {
-#ifndef NETDATA_NO_ATOMIC_INSTRUCTIONS
+#if defined(HAVE_C___ATOMIC) && !defined(NETDATA_NO_ATOMIC_INSTRUCTIONS)
__atomic_fetch_sub(&global_statistics.connected_clients, 1, __ATOMIC_SEQ_CST);
#else
if (web_server_mode == WEB_SERVER_MODE_MULTI_THREADED)
@@ -86,7 +86,7 @@ void web_client_disconnected(void) {
inline void global_statistics_copy(struct global_statistics *gs, uint8_t options) {
-#ifndef NETDATA_NO_ATOMIC_INSTRUCTIONS
+#if defined(HAVE_C___ATOMIC) && !defined(NETDATA_NO_ATOMIC_INSTRUCTIONS)
gs->connected_clients = __atomic_fetch_add(&global_statistics.connected_clients, 0, __ATOMIC_SEQ_CST);
gs->web_requests = __atomic_fetch_add(&global_statistics.web_requests, 0, __ATOMIC_SEQ_CST);
gs->web_usec = __atomic_fetch_add(&global_statistics.web_usec, 0, __ATOMIC_SEQ_CST);
@@ -259,4 +259,4 @@ void global_statistics_charts(void) {
rrddim_set(stcompression, "savings", compression_ratio);
rrdset_done(stcompression);
-} \ No newline at end of file
+}