mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-12 19:02:12 +00:00
sstables: fix calculation of memory footprint for summary
size of keys weren't taken into account, so value reported
via collectd is much smaller than actual footprint.
Signed-off-by: Raphael S. Carvalho <raphaelsc@scylladb.com>
Message-Id: <3ca24612e4e84d1cbdea4f2d79e431a4f4479291.1482255327.git.raphaelsc@scylladb.com>
(cherry picked from commit e28537b56f)
This commit is contained in:
committed by
Avi Kivity
parent
5c96b04f4d
commit
da843239bf
@@ -153,7 +153,12 @@ struct summary_ka {
|
||||
* Similar to origin off heap size
|
||||
*/
|
||||
uint64_t memory_footprint() const {
|
||||
return sizeof(summary_entry) * entries.size() + sizeof(uint32_t) * positions.size() + sizeof(*this);
|
||||
auto sz = sizeof(summary_entry) * entries.size() + sizeof(uint32_t) * positions.size() + sizeof(*this);
|
||||
sz += first_key.value.size() + last_key.value.size();
|
||||
for (auto& e : entries) {
|
||||
sz += e.key.size();
|
||||
}
|
||||
return sz;
|
||||
}
|
||||
|
||||
explicit operator bool() const {
|
||||
|
||||
Reference in New Issue
Block a user