(ixbots) display sent/receive message, per seconds as accumulated
This commit is contained in:
		@@ -1,6 +1,10 @@
 | 
				
			|||||||
# Changelog
 | 
					# Changelog
 | 
				
			||||||
All changes to this project will be documented in this file.
 | 
					All changes to this project will be documented in this file.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## [9.3.3] - 2020-04-17
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(ixbots) display sent/receive message, per seconds as accumulated
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## [9.3.2] - 2020-04-17
 | 
					## [9.3.2] - 2020-04-17
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(ws) add a --logfile option to configure all logs to go to a file
 | 
					(ws) add a --logfile option to configure all logs to go to a file
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -34,16 +34,25 @@ namespace ix
 | 
				
			|||||||
        Json::FastWriter jsonWriter;
 | 
					        Json::FastWriter jsonWriter;
 | 
				
			||||||
        std::atomic<uint64_t> sentCount(0);
 | 
					        std::atomic<uint64_t> sentCount(0);
 | 
				
			||||||
        std::atomic<uint64_t> receivedCount(0);
 | 
					        std::atomic<uint64_t> receivedCount(0);
 | 
				
			||||||
 | 
					        std::atomic<uint64_t> sentCountTotal(0);
 | 
				
			||||||
 | 
					        std::atomic<uint64_t> receivedCountTotal(0);
 | 
				
			||||||
        std::atomic<bool> stop(false);
 | 
					        std::atomic<bool> stop(false);
 | 
				
			||||||
        std::atomic<bool> throttled(false);
 | 
					        std::atomic<bool> throttled(false);
 | 
				
			||||||
        std::atomic<bool> fatalCobraError(false);
 | 
					        std::atomic<bool> fatalCobraError(false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        QueueManager queueManager(maxQueueSize);
 | 
					        QueueManager queueManager(maxQueueSize);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        auto timer = [&sentCount, &receivedCount, &stop] {
 | 
					        auto timer = [&sentCount, &receivedCount, &sentCountTotal, &receivedCountTotal, &stop] {
 | 
				
			||||||
            while (!stop)
 | 
					            while (!stop)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                spdlog::info("messages received {} sent {}", receivedCount, sentCount);
 | 
					                spdlog::info("messages received {} {} sent {} {}",
 | 
				
			||||||
 | 
					                             receivedCount, receivedCountTotal, sentCount, sentCountTotal);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                receivedCountTotal += receivedCount;
 | 
				
			||||||
 | 
					                sentCountTotal += sentCount;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                receivedCount = 0;
 | 
				
			||||||
 | 
					                sentCount = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                auto duration = std::chrono::seconds(1);
 | 
					                auto duration = std::chrono::seconds(1);
 | 
				
			||||||
                std::this_thread::sleep_for(duration);
 | 
					                std::this_thread::sleep_for(duration);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -6,4 +6,4 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#pragma once
 | 
					#pragma once
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define IX_WEBSOCKET_VERSION "9.3.2"
 | 
					#define IX_WEBSOCKET_VERSION "9.3.3"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -19,8 +19,8 @@
 | 
				
			|||||||
#include <ixwebsocket/IXNetSystem.h>
 | 
					#include <ixwebsocket/IXNetSystem.h>
 | 
				
			||||||
#include <ixwebsocket/IXSocket.h>
 | 
					#include <ixwebsocket/IXSocket.h>
 | 
				
			||||||
#include <ixwebsocket/IXUserAgent.h>
 | 
					#include <ixwebsocket/IXUserAgent.h>
 | 
				
			||||||
#include <spdlog/spdlog.h>
 | 
					 | 
				
			||||||
#include <spdlog/sinks/basic_file_sink.h>
 | 
					#include <spdlog/sinks/basic_file_sink.h>
 | 
				
			||||||
 | 
					#include <spdlog/spdlog.h>
 | 
				
			||||||
#include <sstream>
 | 
					#include <sstream>
 | 
				
			||||||
#include <string>
 | 
					#include <string>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user