CobraMetricThreadedPublisher _enable flag is an atomic, and CobraMetricsPublisher is enabled by default
This commit is contained in:
parent
e98ec9ec75
commit
2f730303c2
@ -1,6 +1,9 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
|
## [5.0.3] - 2019-08-14
|
||||||
|
- CobraMetricThreadedPublisher _enable flag is an atomic, and CobraMetricsPublisher is enabled by default
|
||||||
|
|
||||||
## [5.0.2] - 2019-08-01
|
## [5.0.2] - 2019-08-01
|
||||||
- ws cobra_subscribe has a new -q (quiet) option
|
- ws cobra_subscribe has a new -q (quiet) option
|
||||||
- ws cobra_subscribe knows to and display msg stats (count and # of messages received per second)
|
- ws cobra_subscribe knows to and display msg stats (count and # of messages received per second)
|
||||||
|
@ -170,7 +170,7 @@ out = httpClient.post(url, std::string("foo=bar"), args);
|
|||||||
//
|
//
|
||||||
// Result
|
// Result
|
||||||
//
|
//
|
||||||
auto errorCode = response->errorCode; // Can be HttpErrorCode::Ok, HttpErrorCode::UrlMalformed, etc...
|
auto statusCode = response->statusCode; // Can be HttpErrorCode::Ok, HttpErrorCode::UrlMalformed, etc...
|
||||||
auto errorCode = response->errorCode; // 200, 404, etc...
|
auto errorCode = response->errorCode; // 200, 404, etc...
|
||||||
auto responseHeaders = response->headers; // All the headers in a special case-insensitive unordered_map of (string, string)
|
auto responseHeaders = response->headers; // All the headers in a special case-insensitive unordered_map of (string, string)
|
||||||
auto payload = response->payload; // All the bytes from the response as an std::string
|
auto payload = response->payload; // All the bytes from the response as an std::string
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
#include <zlib.h>
|
#include <zlib.h>
|
||||||
|
|
||||||
namespace ix
|
namespace ix
|
||||||
@ -52,6 +53,8 @@ namespace ix
|
|||||||
bool HttpClient::performRequest(HttpRequestArgsPtr args,
|
bool HttpClient::performRequest(HttpRequestArgsPtr args,
|
||||||
const OnResponseCallback& onResponseCallback)
|
const OnResponseCallback& onResponseCallback)
|
||||||
{
|
{
|
||||||
|
assert(_async && "HttpClient needs its async parameter set to true "
|
||||||
|
"in order to call performRequest");
|
||||||
if (!_async) return false;
|
if (!_async) return false;
|
||||||
|
|
||||||
// Enqueue the task
|
// Enqueue the task
|
||||||
|
@ -17,7 +17,7 @@ namespace ix
|
|||||||
const std::string CobraMetricsPublisher::kSetBlacklistId = "sms_set_blacklist_id";
|
const std::string CobraMetricsPublisher::kSetBlacklistId = "sms_set_blacklist_id";
|
||||||
|
|
||||||
CobraMetricsPublisher::CobraMetricsPublisher() :
|
CobraMetricsPublisher::CobraMetricsPublisher() :
|
||||||
_enabled(false)
|
_enabled(true)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <jsoncpp/json/json.h>
|
#include <jsoncpp/json/json.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <atomic>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
||||||
namespace ix
|
namespace ix
|
||||||
@ -132,8 +133,8 @@ namespace ix
|
|||||||
CobraMetricsThreadedPublisher _cobra_metrics_theaded_publisher;
|
CobraMetricsThreadedPublisher _cobra_metrics_theaded_publisher;
|
||||||
|
|
||||||
/// A boolean to enable or disable this system
|
/// A boolean to enable or disable this system
|
||||||
/// push becomes a no-op when _enabled is true
|
/// push becomes a no-op when _enabled is false
|
||||||
bool _enabled;
|
std::atomic<bool> _enabled;
|
||||||
|
|
||||||
/// A uuid used to uniquely identify a session
|
/// A uuid used to uniquely identify a session
|
||||||
std::string _session;
|
std::string _session;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user