db/hints: add a metric for counting processed files

Adds a field to `end_point_hints_manager::sender`:
`_total_replayed_segments_count` which keeps track of how many segments
were replayed so far. This metric will be used to calculate the
sequence number of the last current hint segments in the queue - so
that we can implement waiting for current segments to be replayed.
This commit is contained in:
Piotr Dulikowski
2021-02-24 11:57:44 +01:00
parent e48739a6da
commit 5a49fe74bb
2 changed files with 2 additions and 0 deletions

View File

@@ -885,6 +885,7 @@ void manager::end_point_hints_manager::sender::send_hints_maybe() noexcept {
}
_segments_to_replay.pop_front();
++replayed_segments_count;
++_total_replayed_segments_count;
}
// Ignore exceptions, we will retry sending this file from where we left off the next time.

View File

@@ -153,6 +153,7 @@ public:
seastar::scheduling_group _hints_cpu_sched_group;
gms::gossiper& _gossiper;
seastar::shared_mutex& _file_update_mutex;
uint64_t _total_replayed_segments_count = 0;
public:
sender(end_point_hints_manager& parent, service::storage_proxy& local_storage_proxy, database& local_db, gms::gossiper& local_gossiper) noexcept;