mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 20:12:57 +01:00
fix: update DEFAULT_STATSD_HOST
This commit is contained in:
parent
44d7806478
commit
802efc5efd
@ -34,12 +34,12 @@ std::unique_ptr<StatsdClient> g_stats_client;
|
|||||||
std::unique_ptr<StatsdClient> InitStatsClient(const ArgsManager& args)
|
std::unique_ptr<StatsdClient> InitStatsClient(const ArgsManager& args)
|
||||||
{
|
{
|
||||||
auto is_enabled = args.GetBoolArg("-statsenabled", /*fDefault=*/false);
|
auto is_enabled = args.GetBoolArg("-statsenabled", /*fDefault=*/false);
|
||||||
auto host = args.GetArg("-statshost", /*fDefault=*/"");
|
auto host = args.GetArg("-statshost", /*fDefault=*/DEFAULT_STATSD_HOST);
|
||||||
|
|
||||||
if (is_enabled && host.empty()) {
|
if (is_enabled && host.empty()) {
|
||||||
// Stats are enabled but host has not been specified, then use
|
// Stats are enabled but host has not been specified, then use
|
||||||
// default host. This is to preserve old behavior.
|
// default legacy host. This is to preserve old behavior.
|
||||||
host = DEFAULT_STATSD_HOST;
|
host = "127.0.0.1";
|
||||||
} else if (!host.empty()) {
|
} else if (!host.empty()) {
|
||||||
// Host is specified but stats are not explcitly enabled. Assume
|
// Host is specified but stats are not explcitly enabled. Assume
|
||||||
// that if a host has been specified, we want stats enabled. This
|
// that if a host has been specified, we want stats enabled. This
|
||||||
|
@ -19,7 +19,7 @@ class RawSender;
|
|||||||
/** Default port used to connect to a Statsd server */
|
/** Default port used to connect to a Statsd server */
|
||||||
static constexpr uint16_t DEFAULT_STATSD_PORT{8125};
|
static constexpr uint16_t DEFAULT_STATSD_PORT{8125};
|
||||||
/** Default host assumed to be running a Statsd server */
|
/** Default host assumed to be running a Statsd server */
|
||||||
static const std::string DEFAULT_STATSD_HOST{"127.0.0.1"};
|
static const std::string DEFAULT_STATSD_HOST{""};
|
||||||
/** Default prefix prepended to Statsd message keys */
|
/** Default prefix prepended to Statsd message keys */
|
||||||
static const std::string DEFAULT_STATSD_PREFIX{""};
|
static const std::string DEFAULT_STATSD_PREFIX{""};
|
||||||
/** Default suffix appended to Statsd message keys */
|
/** Default suffix appended to Statsd message keys */
|
||||||
|
Loading…
Reference in New Issue
Block a user