increment counter every time we overrid a message in async mode.

This commit is contained in:
Luiz Siqueira
2018-08-14 08:51:20 -03:00
parent 54896763ab
commit 863f704f47
4 changed files with 22 additions and 0 deletions

View File

@@ -31,6 +31,7 @@ public:
if (tail_ == head_) // overrun last item if full
{
head_ = (head_ + 1) % max_items_;
++overrun_counter_;
}
}
@@ -53,12 +54,19 @@ public:
return ((tail_ + 1) % max_items_) == head_;
}
int overrun_counter() const
{
return overrun_counter_;
}
private:
size_t max_items_;
typename std::vector<T>::size_type head_ = 0;
typename std::vector<T>::size_type tail_ = 0;
std::vector<T> v_;
int overrun_counter_ = 0;
};
} // namespace details
} // namespace spdlog