diff options
author | Henning Baldersheim <balder@oath.com> | 2018-02-05 15:22:48 +0100 |
---|---|---|
committer | Henning Baldersheim <balder@oath.com> | 2018-02-05 15:22:48 +0100 |
commit | 5bae15eab779110e85b77890511ca4c4de63fd7f (patch) | |
tree | d72d98fc1ec7328d5428ea41c45a2fd97bb18f79 /searchcore | |
parent | 24094168ea91eb1663d9fe2f40b8ba62b552ce19 (diff) |
Metric manager must be initialized too, not only metric engine.
Diffstat (limited to 'searchcore')
-rw-r--r-- | searchcore/src/apps/proton/proton.cpp | 7 | ||||
-rw-r--r-- | searchcore/src/vespa/searchcore/proton/server/proton.cpp | 3 |
2 files changed, 6 insertions, 4 deletions
diff --git a/searchcore/src/apps/proton/proton.cpp b/searchcore/src/apps/proton/proton.cpp index 5cdc8e04eb4..70cd8d8a7ad 100644 --- a/searchcore/src/apps/proton/proton.cpp +++ b/searchcore/src/apps/proton/proton.cpp @@ -208,6 +208,11 @@ App::Main() } sigBusHandler.reset(new search::SigBusHandler(stateFile.get())); ioErrorHandler.reset(new search::IOErrorHandler(stateFile.get())); + if ( ! params.serviceidentity.empty()) { + proton.getMetricManager().init(params.serviceidentity, proton.getThreadPool()); + } else { + proton.getMetricManager().init(params.identity, proton.getThreadPool()); + } if (!downPersistence) { proton.init(configSnapshot); } @@ -218,8 +223,6 @@ App::Main() spiProton->setupConfig(params.subscribeTimeout); spiProton->createNode(); EV_STARTED("servicelayer"); - } else { - proton.getMetricManager().init(params.identity, proton.getThreadPool()); } EV_STARTED("proton"); while (!(SIG::INT.check() || SIG::TERM.check() || (spiProton && spiProton->getNode().attemptedStopped()))) { diff --git a/searchcore/src/vespa/searchcore/proton/server/proton.cpp b/searchcore/src/vespa/searchcore/proton/server/proton.cpp index 65a47e1ded8..49f8d50d9d4 100644 --- a/searchcore/src/vespa/searchcore/proton/server/proton.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/proton.cpp @@ -165,7 +165,7 @@ Proton::Proton(const config::ConfigUri & configUri, _configUri(configUri), _mutex(), _metricsHook(*this), - _metricsEngine(), + _metricsEngine(std::make_unique<MetricsEngine>()), _fileHeaderContext(*this, progName), _tls(), _diskMemUsageSampler(), @@ -235,7 +235,6 @@ Proton::init(const BootstrapConfig::SP & configSnapshot) (protonConfig.basedir, diskMemUsageSamplerConfig(protonConfig, hwInfo)); - _metricsEngine.reset(new MetricsEngine()); _metricsEngine->addMetricsHook(_metricsHook); _fileHeaderContext.setClusterName(protonConfig.clustername, protonConfig.basedir); _tls.reset(new TLS(_configUri.createWithNewId(protonConfig.tlsconfigid), _fileHeaderContext)); |