diff options
author | Tor Egge <Tor.Egge@oath.com> | 2017-11-29 10:07:16 +0000 |
---|---|---|
committer | Tor Egge <Tor.Egge@oath.com> | 2017-11-29 10:07:16 +0000 |
commit | a68b198f5ea62d365e336f62f24459229d34643e (patch) | |
tree | 257012d238a7423a781c429333002014adac4a8c /searchcore | |
parent | aa1e45bb4859bc3dd8dbc815eafbd6bd1b9a202b (diff) |
Log event each time transaction log is pruned.
Diffstat (limited to 'searchcore')
3 files changed, 17 insertions, 0 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/common/eventlogger.cpp b/searchcore/src/vespa/searchcore/proton/common/eventlogger.cpp index 49f70092d29..f3afab96cf5 100644 --- a/searchcore/src/vespa/searchcore/proton/common/eventlogger.cpp +++ b/searchcore/src/vespa/searchcore/proton/common/eventlogger.cpp @@ -303,4 +303,18 @@ EventLogger::loadDocumentStoreComplete(const vespalib::string &subDbName, int64_ loadComponentComplete(subDbName, "documentstore", elapsedTimeMs); } +void +EventLogger::transactionLogPruneComplete(const string &domainName, SerialNum prunedSerial) +{ + JSONStringer jstr; + jstr.beginObject(); + jstr.appendKey("domain").appendString(domainName); + jstr.appendKey("serialnum") + .beginObject() + .appendKey("pruned").appendInt64(prunedSerial) + .endObject(); + jstr.endObject(); + EV_STATE("transactionlog.prune.complete", jstr.toString().c_str()); +} + } // namespace proton diff --git a/searchcore/src/vespa/searchcore/proton/common/eventlogger.h b/searchcore/src/vespa/searchcore/proton/common/eventlogger.h index ab3793eb677..6ba8852496e 100644 --- a/searchcore/src/vespa/searchcore/proton/common/eventlogger.h +++ b/searchcore/src/vespa/searchcore/proton/common/eventlogger.h @@ -50,6 +50,7 @@ public: static void loadDocumentMetaStoreComplete(const vespalib::string &subDbName, int64_t elapsedTimeMs); static void loadDocumentStoreStart(const vespalib::string &subDbName); static void loadDocumentStoreComplete(const vespalib::string &subDbName, int64_t elapsedTimeMs); + static void transactionLogPruneComplete(const string &domainName, SerialNum prunedSerial); }; } // namespace proton diff --git a/searchcore/src/vespa/searchcore/proton/server/feedhandler.cpp b/searchcore/src/vespa/searchcore/proton/server/feedhandler.cpp index bc1715e3c04..cc40435819d 100644 --- a/searchcore/src/vespa/searchcore/proton/server/feedhandler.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/feedhandler.cpp @@ -11,6 +11,7 @@ #include <vespa/searchcore/proton/bucketdb/ibucketdbhandler.h> #include <vespa/searchcore/proton/persistenceengine/i_resource_write_filter.h> #include <vespa/searchcore/proton/persistenceengine/transport_latch.h> +#include <vespa/searchcore/proton/common/eventlogger.h> #include <vespa/searchcorespi/index/ithreadingservice.h> #include <vespa/searchlib/common/gatecallback.h> #include <vespa/vespalib/util/exceptions.h> @@ -261,6 +262,7 @@ FeedHandler::performPrune(SerialNum flushedSerial) tlsPrune(flushedSerial); // throws on error LOG(debug, "Pruned TLS to token %" PRIu64 ".", flushedSerial); _owner.onPerformPrune(flushedSerial); + EventLogger::transactionLogPruneComplete(_tlsMgr.getDomainName(), flushedSerial); } catch (const IllegalStateException & e) { LOG(warning, "FeedHandler::performPrune failed due to '%s'.", e.what()); } |