diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2019-12-08 20:11:13 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2019-12-16 23:48:46 +0000 |
commit | c72bdc628b4493bfb2974ab3fe479d2af0d376f1 (patch) | |
tree | ce2f82f3f6f7cfd6ece7ac9ae06edef92986432f /searchcore | |
parent | 6b4486254e67b61e7dbe7dab30ae50d3b0bf01bb (diff) |
WipeHistory has not been used for a very long time.
Diffstat (limited to 'searchcore')
8 files changed, 26 insertions, 26 deletions
diff --git a/searchcore/src/tests/proton/proton_config_fetcher/proton_config_fetcher_test.cpp b/searchcore/src/tests/proton/proton_config_fetcher/proton_config_fetcher_test.cpp index ec31e980a2e..6301b8a343c 100644 --- a/searchcore/src/tests/proton/proton_config_fetcher/proton_config_fetcher_test.cpp +++ b/searchcore/src/tests/proton/proton_config_fetcher/proton_config_fetcher_test.cpp @@ -170,9 +170,9 @@ struct ProtonConfigOwner : public proton::IProtonConfigurer VarHolder<std::shared_ptr<ProtonConfigSnapshot>> _config; ProtonConfigOwner() : _configured(false), _config() { } - bool waitUntilConfigured(int64_t timeout) { - fastos::StopWatch timer; - while (timer.elapsed().ms() < timeout) { + bool waitUntilConfigured(vespalib::duration timeout) { + vespalib::Timer timer; + while (timer.elapsed() < timeout) { if (getConfigured()) return true; std::this_thread::sleep_for(100ms); @@ -290,14 +290,14 @@ TEST_FF("require that documentdb config manager builds schema with imported attr TEST_FFF("require that proton config fetcher follows changes to bootstrap", ConfigTestFixture("search"), ProtonConfigOwner(), - ProtonConfigFetcher(ConfigUri(f1.configId, f1.context), f2, 60000ms)) { + ProtonConfigFetcher(ConfigUri(f1.configId, f1.context), f2, 60s)) { f3.start(); ASSERT_TRUE(f2._configured); ASSERT_TRUE(f1.configEqual(f2.getBootstrapConfig())); f2._configured = false; f1.protonBuilder.rpcport = 9010; f1.reload(); - ASSERT_TRUE(f2.waitUntilConfigured(120000)); + ASSERT_TRUE(f2.waitUntilConfigured(120s)); ASSERT_TRUE(f1.configEqual(f2.getBootstrapConfig())); f3.close(); } @@ -305,19 +305,19 @@ TEST_FFF("require that proton config fetcher follows changes to bootstrap", TEST_FFF("require that proton config fetcher follows changes to doctypes", ConfigTestFixture("search"), ProtonConfigOwner(), - ProtonConfigFetcher(ConfigUri(f1.configId, f1.context), f2, 60000ms)) { + ProtonConfigFetcher(ConfigUri(f1.configId, f1.context), f2, 60s)) { f3.start(); f2._configured = false; f1.addDocType("typea"); f1.reload(); - ASSERT_TRUE(f2.waitUntilConfigured(60000)); + ASSERT_TRUE(f2.waitUntilConfigured(60s)); ASSERT_TRUE(f1.configEqual(f2.getBootstrapConfig())); f2._configured = false; f1.removeDocType("typea"); f1.reload(); - ASSERT_TRUE(f2.waitUntilConfigured(60000)); + ASSERT_TRUE(f2.waitUntilConfigured(60s)); ASSERT_TRUE(f1.configEqual(f2.getBootstrapConfig())); f3.close(); } @@ -325,7 +325,7 @@ TEST_FFF("require that proton config fetcher follows changes to doctypes", TEST_FFF("require that proton config fetcher reconfigures dbowners", ConfigTestFixture("search"), ProtonConfigOwner(), - ProtonConfigFetcher(ConfigUri(f1.configId, f1.context), f2, 60000ms)) { + ProtonConfigFetcher(ConfigUri(f1.configId, f1.context), f2, 60s)) { f3.start(); ASSERT_FALSE(f2.getDocumentDBConfig("typea")); @@ -333,7 +333,7 @@ TEST_FFF("require that proton config fetcher reconfigures dbowners", f2._configured = false; f1.addDocType("typea"); f1.reload(); - ASSERT_TRUE(f2.waitUntilConfigured(60000)); + ASSERT_TRUE(f2.waitUntilConfigured(60s)); ASSERT_TRUE(f1.configEqual(f2.getBootstrapConfig())); ASSERT_TRUE(static_cast<bool>(f2.getDocumentDBConfig("typea"))); ASSERT_TRUE(f1.configEqual("typea", f2.getDocumentDBConfig("typea"))); @@ -342,7 +342,7 @@ TEST_FFF("require that proton config fetcher reconfigures dbowners", f2._configured = false; f1.removeDocType("typea"); f1.reload(); - ASSERT_TRUE(f2.waitUntilConfigured(60000)); + ASSERT_TRUE(f2.waitUntilConfigured(60s)); ASSERT_FALSE(f2.getDocumentDBConfig("typea")); f3.close(); } diff --git a/searchcore/src/vespa/searchcore/proton/attribute/attribute_initializer.cpp b/searchcore/src/vespa/searchcore/proton/attribute/attribute_initializer.cpp index bb41004d834..0ccebd34a39 100644 --- a/searchcore/src/vespa/searchcore/proton/attribute/attribute_initializer.cpp +++ b/searchcore/src/vespa/searchcore/proton/attribute/attribute_initializer.cpp @@ -175,7 +175,7 @@ AttributeInitializer::loadAttribute(const AttributeVectorSP &attr, search::SerialNum serialNum) const { assert(attr->hasLoadData()); - fastos::StopWatch stopWatch; + vespalib::Timer timer; EventLogger::loadAttributeStart(_documentSubDbName, attr->getName()); if (!attr->load()) { LOG(warning, "Could not load attribute vector '%s' from disk. Returning empty attribute vector", @@ -183,7 +183,7 @@ AttributeInitializer::loadAttribute(const AttributeVectorSP &attr, return false; } else { attr->commit(serialNum, serialNum); - EventLogger::loadAttributeComplete(_documentSubDbName, attr->getName(), stopWatch.elapsed().ms()); + EventLogger::loadAttributeComplete(_documentSubDbName, attr->getName(), vespalib::count_ms(timer.elapsed())); } return true; } diff --git a/searchcore/src/vespa/searchcore/proton/docsummary/summarymanagerinitializer.cpp b/searchcore/src/vespa/searchcore/proton/docsummary/summarymanagerinitializer.cpp index 1915d9107cc..415d13314a2 100644 --- a/searchcore/src/vespa/searchcore/proton/docsummary/summarymanagerinitializer.cpp +++ b/searchcore/src/vespa/searchcore/proton/docsummary/summarymanagerinitializer.cpp @@ -38,12 +38,12 @@ void SummaryManagerInitializer::run() { vespalib::mkdir(_baseDir, false); - fastos::StopWatch stopWatch; + vespalib::Timer timer; EventLogger::loadDocumentStoreStart(_subDbName); *_result = std::make_shared<SummaryManager> (_summaryExecutor, _storeCfg, _grow, _baseDir, _docTypeName, _tuneFile, _fileHeaderContext, _tlSyncer, _bucketizer); - EventLogger::loadDocumentStoreComplete(_subDbName, stopWatch.elapsed().ms()); + EventLogger::loadDocumentStoreComplete(_subDbName, vespalib::count_ms(timer.elapsed())); } } // namespace proton diff --git a/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp b/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp index 0be67a424ee..2ec3488fe3c 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp +++ b/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp @@ -185,7 +185,7 @@ Matcher::match(const SearchRequest &request, vespalib::ThreadBundle &threadBundl ISearchContext &searchContext, IAttributeContext &attrContext, SessionManager &sessionMgr, const search::IDocumentMetaStore &metaStore, SearchSession::OwnershipBundle &&owned_objects) { - fastos::StopWatch total_matching_time; + vespalib::Timer total_matching_time; MatchingStats my_stats; SearchReply::UP reply = std::make_unique<SearchReply>(); size_t covered = 0; @@ -286,7 +286,7 @@ Matcher::match(const SearchRequest &request, vespalib::ThreadBundle &threadBundl numThreadsPerSearch, _rankSetup->getNumThreadsPerSearch(), estHits, reply->totalHitCount, request.ranking.c_str()); } - my_stats.queryCollateralTime(total_matching_time.elapsed().sec() - my_stats.queryLatencyAvg()); + my_stats.queryCollateralTime(vespalib::to_s(total_matching_time.elapsed()) - my_stats.queryLatencyAvg()); { vespalib::duration duration = request.getTimeUsed(); std::lock_guard<std::mutex> guard(_statsLock); diff --git a/searchcore/src/vespa/searchcore/proton/server/transactionlogmanager.cpp b/searchcore/src/vespa/searchcore/proton/server/transactionlogmanager.cpp index 271393ea3c8..3ad98cba3ac 100644 --- a/searchcore/src/vespa/searchcore/proton/server/transactionlogmanager.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/transactionlogmanager.cpp @@ -18,9 +18,9 @@ namespace proton { void TransactionLogManager::doLogReplayComplete(const vespalib::string &domainName, - std::chrono::milliseconds elapsedTime) const + vespalib::duration elapsedTime) const { - EventLogger::transactionLogReplayComplete(domainName, elapsedTime.count()); + EventLogger::transactionLogReplayComplete(domainName, vespalib::count_ms(elapsedTime)); } diff --git a/searchcore/src/vespa/searchcore/proton/server/transactionlogmanager.h b/searchcore/src/vespa/searchcore/proton/server/transactionlogmanager.h index 82c4f9f7449..15666c38483 100644 --- a/searchcore/src/vespa/searchcore/proton/server/transactionlogmanager.h +++ b/searchcore/src/vespa/searchcore/proton/server/transactionlogmanager.h @@ -18,7 +18,7 @@ class TransactionLogManager : public TransactionLogManagerBase { TransLogClient::Visitor::UP _visitor; - void doLogReplayComplete(const vespalib::string &domainName, std::chrono::milliseconds elapsedTime) const override; + void doLogReplayComplete(const vespalib::string &domainName, vespalib::duration elapsedTime) const override; public: /** @@ -28,7 +28,7 @@ public: * @param domainName the name of the domain this manager should handle. **/ TransactionLogManager(const vespalib::string &tlsSpec, const vespalib::string &domainName); - ~TransactionLogManager(); + ~TransactionLogManager() override; /** * Init the transaction log. diff --git a/searchcore/src/vespa/searchcore/proton/server/transactionlogmanagerbase.cpp b/searchcore/src/vespa/searchcore/proton/server/transactionlogmanagerbase.cpp index 985e042c97b..8b18a7ae566 100644 --- a/searchcore/src/vespa/searchcore/proton/server/transactionlogmanagerbase.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/transactionlogmanagerbase.cpp @@ -69,7 +69,7 @@ TransactionLogManagerBase::internalStartReplay() std::lock_guard<std::mutex> guard(_replayLock); _replayStarted = true; _replayDone = false; - _replayStopWatch.restart(); + _replayStopWatch = vespalib::Timer(); } void TransactionLogManagerBase::changeReplayDone() @@ -117,7 +117,7 @@ bool TransactionLogManagerBase::isDoingReplay() const { } void TransactionLogManagerBase::logReplayComplete() const { - doLogReplayComplete(_domainName, std::chrono::milliseconds(_replayStopWatch.elapsed().ms())); + doLogReplayComplete(_domainName, _replayStopWatch.elapsed()); } } // namespace proton diff --git a/searchcore/src/vespa/searchcore/proton/server/transactionlogmanagerbase.h b/searchcore/src/vespa/searchcore/proton/server/transactionlogmanagerbase.h index 8c4bc2bbfa3..4b5d001a28e 100644 --- a/searchcore/src/vespa/searchcore/proton/server/transactionlogmanagerbase.h +++ b/searchcore/src/vespa/searchcore/proton/server/transactionlogmanagerbase.h @@ -3,9 +3,9 @@ #pragma once #include <vespa/searchlib/transactionlog/translogclient.h> +#include <vespa/vespalib/util/time.h> #include <mutex> #include <condition_variable> -#include <vespa/fastos/timestamp.h> namespace proton { @@ -23,7 +23,7 @@ private: mutable std::condition_variable _replayCond; volatile bool _replayDone; bool _replayStarted; - fastos::StopWatch _replayStopWatch; + vespalib::Timer _replayStopWatch; protected: typedef search::SerialNum SerialNum; @@ -38,7 +38,7 @@ protected: StatusResult init(); void internalStartReplay(); - virtual void doLogReplayComplete(const vespalib::string &domainName, std::chrono::milliseconds elapsedTime) const = 0; + virtual void doLogReplayComplete(const vespalib::string &domainName, vespalib::duration elapsedTime) const = 0; public: TransactionLogManagerBase(const TransactionLogManagerBase &) = delete; |