From 60f6f1883e764d06c0d6996985ace97458dbc1de Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Mon, 9 Aug 2021 12:03:50 +0000 Subject: Add some debug logging. --- .../searchcore/proton/server/memory_flush_config_updater.cpp | 4 ++-- .../src/vespa/searchcore/proton/server/memoryflush.cpp | 12 ++++++++++++ searchcore/src/vespa/searchcore/proton/server/memoryflush.h | 1 + 3 files changed, 15 insertions(+), 2 deletions(-) (limited to 'searchcore') diff --git a/searchcore/src/vespa/searchcore/proton/server/memory_flush_config_updater.cpp b/searchcore/src/vespa/searchcore/proton/server/memory_flush_config_updater.cpp index b842820bfe1..8f9bc4b4aeb 100644 --- a/searchcore/src/vespa/searchcore/proton/server/memory_flush_config_updater.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/memory_flush_config_updater.cpp @@ -78,11 +78,11 @@ MemoryFlushConfigUpdater::updateFlushStrategy(const LockGuard &guard, const char if ( currentConfig != newConfig ) { _flushStrategy->setConfig(newConfig); LOG(info, "Due to %s (conservative-disk=%d, conservative-memory=%d, retired=%d) flush config updated to " - "global-disk-bloat(%1.2f), max-tls-size(%" PRIu64 ")," - "max-global-memory(%" PRIu64 "), max-memory-gain(%" PRIu64 ")", + "global-disk-bloat(%1.2f), max-tls-size(%" PRIu64 "),max-global-memory(%" PRIu64 "), max-memory-gain(%" PRIu64 ")", why, _useConservativeDiskMode, _useConservativeMemoryMode, _nodeRetired, newConfig.globalDiskBloatFactor, newConfig.maxGlobalTlsSize, newConfig.maxGlobalMemory, newConfig.maxMemoryGain); + LOG(debug, "Old config = %s\nNew config = %s", currentConfig.toString().c_str(), newConfig.toString().c_str()); } } diff --git a/searchcore/src/vespa/searchcore/proton/server/memoryflush.cpp b/searchcore/src/vespa/searchcore/proton/server/memoryflush.cpp index a3f27aa7a92..8baa06e2bb6 100644 --- a/searchcore/src/vespa/searchcore/proton/server/memoryflush.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/memoryflush.cpp @@ -74,6 +74,18 @@ MemoryFlush::Config::Config(uint64_t maxGlobalMemory_in, maxTimeGain(maxTimeGain_in) { } +vespalib::string +MemoryFlush::Config::toString() const { + vespalib::asciistream os; + os << "maxGlobalMemory=" << maxGlobalMemory << " "; + os << "maxGlobalTlsSize=" << maxGlobalTlsSize << " "; + os << "globalDiskBloatFactor=" << globalDiskBloatFactor << " "; + os << "maxMemoryGain=" << maxMemoryGain << " "; + os << "diskBloatFactor=" << diskBloatFactor << " "; + os << "maxTimeGain(ns)=" << maxTimeGain.count(); + return os.str(); +} + MemoryFlush::MemoryFlush(const Config &config, vespalib::system_time startTime) : _lock(), _config(config), diff --git a/searchcore/src/vespa/searchcore/proton/server/memoryflush.h b/searchcore/src/vespa/searchcore/proton/server/memoryflush.h index 1e8d1b1f08c..3ea34c10e52 100644 --- a/searchcore/src/vespa/searchcore/proton/server/memoryflush.h +++ b/searchcore/src/vespa/searchcore/proton/server/memoryflush.h @@ -44,6 +44,7 @@ public: (maxTimeGain == rhs.maxTimeGain) && (diskBloatFactor == rhs. diskBloatFactor); } + vespalib::string toString() const; }; enum OrderType { DEFAULT, MAXAGE, DISKBLOAT, TLSSIZE, MEMORY }; -- cgit v1.2.3