summaryrefslogtreecommitdiffstats
path: root/storage
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@yahooinc.com>2022-01-31 14:15:49 +0000
committerTor Brede Vekterli <vekterli@yahooinc.com>2022-01-31 14:15:49 +0000
commit9861ab1789e2ed1804a658e9ef65b72be38cdbaa (patch)
treedc554893dde6a7f17b04faf1614e7e52b0a954b2 /storage
parentbd05e78a364b6f1d0a4f5ba8088e1ec1ee02a463 (diff)
Don't set deprecated fields when aggregating visitor statistics
The 1st/2nd pass functionality has been deprecated for a long time, but unfortunately the documents/bytes visited stats have been wired to be returned as part of 2nd phase statistics instead of the regular higher-level fields. This commit changes this, but the serialization will still have to remain in place until Vespa 8.
Diffstat (limited to 'storage')
-rw-r--r--storage/src/vespa/storage/visiting/visitor.cpp26
-rw-r--r--storage/src/vespa/storage/visiting/visitor.h19
2 files changed, 10 insertions, 35 deletions
diff --git a/storage/src/vespa/storage/visiting/visitor.cpp b/storage/src/vespa/storage/visiting/visitor.cpp
index b66285f5048..e8a217fc718 100644
--- a/storage/src/vespa/storage/visiting/visitor.cpp
+++ b/storage/src/vespa/storage/visiting/visitor.cpp
@@ -24,35 +24,23 @@ using document::BucketSpace;
namespace storage {
Visitor::HitCounter::HitCounter()
- : _firstPassHits(0),
- _firstPassBytes(0),
- _secondPassHits(0),
- _secondPassBytes(0)
+ : _doc_hits(0),
+ _doc_bytes(0)
{
}
void
Visitor::HitCounter::addHit(const document::DocumentId& , uint32_t size)
{
- bool firstPass = false;
-
- if (firstPass) {
- _firstPassHits++;
- _firstPassBytes += size;
- } else {
- _secondPassHits++;
- _secondPassBytes += size;
- }
-
+ _doc_hits++;
+ _doc_bytes += size;
}
void
-Visitor::HitCounter::updateVisitorStatistics(vdslib::VisitorStatistics& statistics)
+Visitor::HitCounter::updateVisitorStatistics(vdslib::VisitorStatistics& statistics) const
{
- statistics.setDocumentsReturned(statistics.getDocumentsReturned() + _firstPassHits);
- statistics.setBytesReturned(statistics.getBytesReturned() + _firstPassBytes);
- statistics.setSecondPassDocumentsReturned(statistics.getSecondPassDocumentsReturned() + _secondPassHits);
- statistics.setSecondPassBytesReturned(statistics.getSecondPassBytesReturned() + _secondPassBytes);
+ statistics.setDocumentsReturned(statistics.getDocumentsReturned() + _doc_hits);
+ statistics.setBytesReturned(statistics.getBytesReturned() + _doc_bytes);
}
Visitor::VisitorTarget::MessageMeta::MessageMeta(
diff --git a/storage/src/vespa/storage/visiting/visitor.h b/storage/src/vespa/storage/visiting/visitor.h
index 8857a54e8df..11192021577 100644
--- a/storage/src/vespa/storage/visiting/visitor.h
+++ b/storage/src/vespa/storage/visiting/visitor.h
@@ -89,24 +89,11 @@ public:
class HitCounter {
public:
HitCounter();
-
void addHit(const document::DocumentId& hit, uint32_t size);
-
- void updateVisitorStatistics(vdslib::VisitorStatistics& statistics);
-
- uint32_t getFirstPassHits() const { return _firstPassHits; }
-
- uint64_t getFirstPassBytes() const { return _firstPassBytes; }
-
- uint32_t getSecondPassHits() const { return _secondPassHits; }
-
- uint64_t getSecondPassBytes() const { return _secondPassBytes; }
-
+ void updateVisitorStatistics(vdslib::VisitorStatistics& statistics) const;
private:
- uint32_t _firstPassHits;
- uint64_t _firstPassBytes;
- uint32_t _secondPassHits;
- uint64_t _secondPassBytes;
+ uint32_t _doc_hits;
+ uint64_t _doc_bytes;
};
enum VisitorState