]> arthur.barton.de Git - netdata.git/blobdiff - src/global_statistics.h
Merge pull request #1952 from ktsaou/master
[netdata.git] / src / global_statistics.h
index 56a8118c727fb27f3aea58f7a0ee7f2d6547baa5..d28aa4401ce464d4e97b2724a8b48be8314d8ebc 100644 (file)
@@ -5,18 +5,32 @@
 // global statistics
 
 struct global_statistics {
-       volatile unsigned long volatile connected_clients;
-       volatile unsigned long long volatile web_requests;
-       volatile unsigned long long volatile web_usec;
-       volatile unsigned long long volatile bytes_received;
-       volatile unsigned long long volatile bytes_sent;
-       volatile unsigned long long volatile content_size;
-       volatile unsigned long long volatile compressed_content_size;
+    volatile uint16_t connected_clients;
+
+    volatile uint64_t web_requests;
+    volatile uint64_t web_usec;
+    volatile uint64_t web_usec_max;
+    volatile uint64_t bytes_received;
+    volatile uint64_t bytes_sent;
+    volatile uint64_t content_size;
+    volatile uint64_t compressed_content_size;
 };
 
-extern struct global_statistics global_statistics;
+extern volatile struct global_statistics global_statistics;
 
 extern void global_statistics_lock(void);
 extern void global_statistics_unlock(void);
+extern void finished_web_request_statistics(uint64_t dt,
+                                     uint64_t bytes_received,
+                                     uint64_t bytes_sent,
+                                     uint64_t content_size,
+                                     uint64_t compressed_content_size);
+
+extern void web_client_connected(void);
+extern void web_client_disconnected(void);
+
+#define GLOBAL_STATS_RESET_WEB_USEC_MAX 0x01
+extern void global_statistics_copy(struct global_statistics *gs, uint8_t options);
+extern void global_statistics_charts(void);
 
 #endif /* NETDATA_GLOBAL_STATISTICS_H */