Skip to content

Commit

Permalink
HPCC-33295 SOAP request count metric name has illegal name
Browse files Browse the repository at this point in the history
Fixed metric name by replacing '_' with '.'
Moved statically allocated metric to constructor and protected with
std::call_once

Signed-Off-By: Kenneth Rowland kenneth.rowland@lexisnexisrisk.com
  • Loading branch information
kenrowland committed Jan 29, 2025
1 parent 2551454 commit 6aaf60c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions esp/bindings/SOAP/Platform/soapbind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@
#include "SOAP/xpp/xjx/xjxpp.hpp"
#include "jmetrics.hpp"

static std::once_flag metricsInitialized;
#ifdef _SOLVED_DYNAMIC_METRIC_PROBLEM
static auto pSoapRequestCount = hpccMetrics::registerCounterMetric("esp.soap_requests.received", "Number of JSON and SOAP POST requests received", SMeasureCount);
static std::shared_ptr<hpccMetrics::CounterMetric> pSoapRequestCount;
#endif


Expand Down Expand Up @@ -68,15 +69,20 @@ int CSoapBinding::processRequest(IRpcMessage* rpc_call, IRpcMessage* rpc_respons
return 0;
}

CHttpSoapBinding::CHttpSoapBinding():EspHttpBinding(NULL, NULL, NULL)
CHttpSoapBinding::CHttpSoapBinding()
:CHttpSoapBinding(NULL, NULL, NULL)
{
log_level_=hsl_none;
}

CHttpSoapBinding::CHttpSoapBinding(IPropertyTree* cfg, const char *bindname, const char *procname, http_soap_log_level level)
: EspHttpBinding(cfg, bindname, procname)
{
log_level_=level;
#ifdef _SOLVED_DYNAMIC_METRIC_PROBLEM
std::call_once(metricsInitialized, [](){
pSoapRequestCount = hpccMetrics::registerCounterMetric("esp.soap.requests.received", "Number of JSON and SOAP POST requests received", SMeasureCount);
});
#endif
}

CHttpSoapBinding::~CHttpSoapBinding()
Expand Down

0 comments on commit 6aaf60c

Please sign in to comment.