summaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorGeir Storli <geirst@oath.com>2018-09-03 14:15:44 +0000
committerGeir Storli <geirst@oath.com>2018-09-04 11:06:30 +0000
commit1345decdf36df8695a2133081fcd40c88e50ab69 (patch)
treed2e54036f186bcc75f05e206b6fc4d422e2dbb5c /searchcore
parent6f85828e47a5bb88a0937589e55e6133f5a4ec4b (diff)
Extend flush complete event log message with flushed serial number of the target.
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/vespa/searchcore/proton/common/eventlogger.cpp6
-rw-r--r--searchcore/src/vespa/searchcore/proton/common/eventlogger.h1
-rw-r--r--searchcore/src/vespa/searchcore/proton/flushengine/flushengine.cpp3
3 files changed, 8 insertions, 2 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/common/eventlogger.cpp b/searchcore/src/vespa/searchcore/proton/common/eventlogger.cpp
index 52c4899506f..5966589d635 100644
--- a/searchcore/src/vespa/searchcore/proton/common/eventlogger.cpp
+++ b/searchcore/src/vespa/searchcore/proton/common/eventlogger.cpp
@@ -109,13 +109,17 @@ EventLogger::flushStart(const string &name, int64_t beforeMemory, int64_t afterM
}
void
-EventLogger::flushComplete(const string &name, int64_t elapsedTimeMs,
+EventLogger::flushComplete(const string &name, int64_t elapsedTimeMs, SerialNum flushed,
const string &outputPath, size_t outputPathElems)
{
JSONStringer jstr;
jstr.beginObject();
jstr.appendKey("name").appendString(name);
jstr.appendKey("time.elapsed.ms").appendInt64(elapsedTimeMs);
+ jstr.appendKey("serialnum")
+ .beginObject()
+ .appendKey("flushed").appendInt64(flushed)
+ .endObject();
if (!outputPath.empty()) {
jstr.appendKey("output");
LogUtil::logDir(jstr, outputPath, outputPathElems);
diff --git a/searchcore/src/vespa/searchcore/proton/common/eventlogger.h b/searchcore/src/vespa/searchcore/proton/common/eventlogger.h
index c5d0d878924..574e650732a 100644
--- a/searchcore/src/vespa/searchcore/proton/common/eventlogger.h
+++ b/searchcore/src/vespa/searchcore/proton/common/eventlogger.h
@@ -41,6 +41,7 @@ public:
SerialNum current);
static void flushComplete(const string &name,
int64_t elapsedTimeMs,
+ SerialNum flushed,
const string &outputPath,
size_t outputPathElems);
static void flushPrune(const string &name, SerialNum oldestFlushed);
diff --git a/searchcore/src/vespa/searchcore/proton/flushengine/flushengine.cpp b/searchcore/src/vespa/searchcore/proton/flushengine/flushengine.cpp
index 490e31f6fd4..f7e0b7981bb 100644
--- a/searchcore/src/vespa/searchcore/proton/flushengine/flushengine.cpp
+++ b/searchcore/src/vespa/searchcore/proton/flushengine/flushengine.cpp
@@ -355,7 +355,8 @@ FlushEngine::flushDone(const FlushContext &ctx, uint32_t taskId)
}
if (LOG_WOULD_LOG(event)) {
FlushStats stats = ctx.getTarget()->getLastFlushStats();
- EventLogger::flushComplete(ctx.getName(), duration.ms(), stats.getPath(), stats.getPathElementsToLog());
+ EventLogger::flushComplete(ctx.getName(), duration.ms(), ctx.getTarget()->getFlushedSerialNum(),
+ stats.getPath(), stats.getPathElementsToLog());
}
LOG(debug, "FlushEngine::flushDone(taskId='%d') took '%f' secs", taskId, duration.sec());
std::lock_guard<std::mutex> guard(_lock);