mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-12 19:02:12 +00:00
Add collectd counter for uncached wide partitions.
Keep track of every read of wide partition that's not cached. Signed-off-by: Piotr Jastrzebski <piotr@scylladb.com>
This commit is contained in:
Notes:
Pekka Enberg
2016-07-27 14:09:40 +03:00
backport: 1.3
15
row_cache.cc
15
row_cache.cc
@@ -119,6 +119,11 @@ cache_tracker::setup_collectd() {
|
||||
, "total_operations", "misses")
|
||||
, scollectd::make_typed(scollectd::data_type::DERIVE, _misses)
|
||||
),
|
||||
scollectd::add_polled_metric(scollectd::type_instance_id("cache"
|
||||
, scollectd::per_cpu_plugin_instance
|
||||
, "total_operations", "uncached_wide_partitions")
|
||||
, scollectd::make_typed(scollectd::data_type::DERIVE, _uncached_wide_partitions)
|
||||
),
|
||||
scollectd::add_polled_metric(scollectd::type_instance_id("cache"
|
||||
, scollectd::per_cpu_plugin_instance
|
||||
, "total_operations", "insertions")
|
||||
@@ -196,6 +201,10 @@ void cache_tracker::on_miss() {
|
||||
++_misses;
|
||||
}
|
||||
|
||||
void cache_tracker::on_uncached_wide_partition() {
|
||||
++_uncached_wide_partitions;
|
||||
}
|
||||
|
||||
allocation_strategy& cache_tracker::allocator() {
|
||||
return _region.allocator();
|
||||
}
|
||||
@@ -248,6 +257,7 @@ public:
|
||||
}
|
||||
return make_ready_future<streamed_mutation_opt>(streamed_mutation_opt());
|
||||
} else {
|
||||
_cache.on_uncached_wide_partition();
|
||||
auto reader = _underlying(_schema,
|
||||
query::partition_range::make_singular(dht::ring_position(std::move(dk))),
|
||||
_ck_filtering,
|
||||
@@ -269,6 +279,10 @@ void row_cache::on_miss() {
|
||||
_tracker.on_miss();
|
||||
}
|
||||
|
||||
void row_cache::on_uncached_wide_partition() {
|
||||
_tracker.on_uncached_wide_partition();
|
||||
}
|
||||
|
||||
class just_cache_scanning_reader final {
|
||||
schema_ptr _schema;
|
||||
row_cache& _cache;
|
||||
@@ -457,6 +471,7 @@ public:
|
||||
} else {
|
||||
assert(bool(dk));
|
||||
_last_key = std::experimental::optional<dht::ring_position>();
|
||||
_cache.on_uncached_wide_partition();
|
||||
auto reader = _underlying(_schema,
|
||||
query::partition_range::make_singular(dht::ring_position(std::move(*dk))),
|
||||
_ck_filtering,
|
||||
|
||||
@@ -149,6 +149,7 @@ public:
|
||||
private:
|
||||
uint64_t _hits = 0;
|
||||
uint64_t _misses = 0;
|
||||
uint64_t _uncached_wide_partitions = 0;
|
||||
uint64_t _insertions = 0;
|
||||
uint64_t _merges = 0;
|
||||
uint64_t _evictions = 0;
|
||||
@@ -170,6 +171,7 @@ public:
|
||||
void on_merge();
|
||||
void on_hit();
|
||||
void on_miss();
|
||||
void on_uncached_wide_partition();
|
||||
allocation_strategy& allocator();
|
||||
logalloc::region& region();
|
||||
const logalloc::region& region() const;
|
||||
@@ -232,6 +234,7 @@ private:
|
||||
query::clustering_key_filtering_context ck_filtering);
|
||||
void on_hit();
|
||||
void on_miss();
|
||||
void on_uncached_wide_partition();
|
||||
void upgrade_entry(cache_entry&);
|
||||
void invalidate_locked(const dht::decorated_key&);
|
||||
void invalidate_unwrapped(const query::partition_range&);
|
||||
|
||||
Reference in New Issue
Block a user