column family: Add estimated histogram impl

This patch adds the read and write latency estimated histogram support
and add an estimatd histogram to the number of sstable that were used in
a read.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
This commit is contained in:
Amnon Heiman
2015-10-08 14:55:02 +03:00
parent 9c16b56b65
commit 6d90eebfb9
2 changed files with 10 additions and 0 deletions

View File

@@ -1337,6 +1337,9 @@ column_family::query(const query::read_command& cmd, const std::vector<query::pa
});
}).finally([lc, this]() mutable {
_stats.reads.mark(lc);
if (lc.is_start()) {
_stats.estimated_read.add(lc.latency_in_nano(), _stats.reads.count);
}
});
}

View File

@@ -125,6 +125,7 @@ public:
utils::ihistogram writes{256};
sstables::estimated_histogram estimated_read;
sstables::estimated_histogram estimated_write;
sstables::estimated_histogram estimated_sstable_per_read;
};
private:
@@ -586,6 +587,9 @@ column_family::apply(const mutation& m, const db::replay_position& rp) {
active_memtable().apply(m, rp);
seal_on_overflow();
_stats.writes.mark(lc);
if (lc.is_start()) {
_stats.estimated_write.add(lc.latency_in_nano(), _stats.writes.count);
}
}
inline
@@ -617,6 +621,9 @@ column_family::apply(const frozen_mutation& m, const db::replay_position& rp) {
active_memtable().apply(m, rp);
seal_on_overflow();
_stats.writes.mark(lc);
if (lc.is_start()) {
_stats.estimated_write.add(lc.latency_in_nano(), _stats.writes.count);
}
}
future<> update_schema_version_and_announce(distributed<service::storage_proxy>& proxy);