{
std::lock_guard<std::mutex> l(cache->lock);
res.clear();
+ res_intervals.clear();
+ uint64_t want_bytes = length;
uint64_t end = offset + length;
for (auto i = _data_lower_bound(offset);
i != buffer_map.end() && offset < end && i->first < end;
}
}
}
+
+ uint64_t hit_bytes = res_intervals.size();
+ assert(hit_bytes <= want_bytes);
+ uint64_t miss_bytes = want_bytes - hit_bytes;
+ cache->store->logger->inc(l_bluestore_buffer_hit_bytes, hit_bytes);
+ cache->store->logger->inc(l_bluestore_buffer_miss_bytes, miss_bytes);
}
void BlueStore::BufferSpace::finish_write(uint64_t seq)
ceph::unordered_map<ghobject_t,OnodeRef>::iterator p = onode_map.find(oid);
if (p == onode_map.end()) {
dout(30) << __func__ << " " << oid << " miss" << dendl;
+ cache->store->logger->inc(l_bluestore_onode_misses);
return OnodeRef();
}
dout(30) << __func__ << " " << oid << " hit " << p->second << dendl;
cache->_touch_onode(p->second);
+ cache->store->logger->inc(l_bluestore_onode_hits);
return p->second;
}
{
PerfCountersBuilder b(g_ceph_context, "BlueStore",
l_bluestore_first, l_bluestore_last);
- b.add_time_avg(l_bluestore_state_prepare_lat, "state_prepare_lat", "Average prepare state latency");
- b.add_time_avg(l_bluestore_state_aio_wait_lat, "state_aio_wait_lat", "Average aio_wait state latency");
- b.add_time_avg(l_bluestore_state_io_done_lat, "state_io_done_lat", "Average io_done state latency");
- b.add_time_avg(l_bluestore_state_kv_queued_lat, "state_kv_queued_lat", "Average kv_queued state latency");
- b.add_time_avg(l_bluestore_state_kv_committing_lat, "state_kv_commiting_lat", "Average kv_commiting state latency");
- b.add_time_avg(l_bluestore_state_kv_done_lat, "state_kv_done_lat", "Average kv_done state latency");
- b.add_time_avg(l_bluestore_state_wal_queued_lat, "state_wal_queued_lat", "Average wal_queued state latency");
- b.add_time_avg(l_bluestore_state_wal_applying_lat, "state_wal_applying_lat", "Average wal_applying state latency");
- b.add_time_avg(l_bluestore_state_wal_aio_wait_lat, "state_wal_aio_wait_lat", "Average aio_wait state latency");
- b.add_time_avg(l_bluestore_state_wal_cleanup_lat, "state_wal_cleanup_lat", "Average cleanup state latency");
- b.add_time_avg(l_bluestore_state_finishing_lat, "state_finishing_lat", "Average finishing state latency");
- b.add_time_avg(l_bluestore_state_done_lat, "state_done_lat", "Average done state latency");
- b.add_time_avg(l_bluestore_compress_lat, "compress_lat", "Average compress latency");
- b.add_time_avg(l_bluestore_decompress_lat, "decompress_lat", "Average decompress latency");
- b.add_u64(l_bluestore_compress_success_count, "compress_success_count", "Sum for beneficial compress ops");
-
- b.add_u64(l_bluestore_write_pad_bytes, "write_pad_bytes", "Sum for write-op padded bytes");
- b.add_u64(l_bluestore_wal_write_ops, "wal_write_ops", "Sum for wal write op");
- b.add_u64(l_bluestore_wal_write_bytes, "wal_write_bytes", "Sum for wal write bytes");
- b.add_u64(l_bluestore_write_penalty_read_ops, " write_penalty_read_ops", "Sum for write penalty read ops");
- b.add_u64(l_bluestore_allocated, "bluestore_allocated", "Sum for allocated bytes");
- b.add_u64(l_bluestore_stored, "bluestore_stored", "Sum for stored bytes");
- b.add_u64(l_bluestore_compressed, "bluestore_compressed", "Sum for stored compressed bytes");
- b.add_u64(l_bluestore_compressed_allocated, "bluestore_compressed_allocated", "Sum for bytes allocated for compressed data");
- b.add_u64(l_bluestore_compressed_original, "bluestore_compressed_original", "Sum for original bytes that were compressed");
+ b.add_time_avg(l_bluestore_state_prepare_lat, "state_prepare_lat",
+ "Average prepare state latency");
+ b.add_time_avg(l_bluestore_state_aio_wait_lat, "state_aio_wait_lat",
+ "Average aio_wait state latency");
+ b.add_time_avg(l_bluestore_state_io_done_lat, "state_io_done_lat",
+ "Average io_done state latency");
+ b.add_time_avg(l_bluestore_state_kv_queued_lat, "state_kv_queued_lat",
+ "Average kv_queued state latency");
+ b.add_time_avg(l_bluestore_state_kv_committing_lat, "state_kv_commiting_lat",
+ "Average kv_commiting state latency");
+ b.add_time_avg(l_bluestore_state_kv_done_lat, "state_kv_done_lat",
+ "Average kv_done state latency");
+ b.add_time_avg(l_bluestore_state_wal_queued_lat, "state_wal_queued_lat",
+ "Average wal_queued state latency");
+ b.add_time_avg(l_bluestore_state_wal_applying_lat, "state_wal_applying_lat",
+ "Average wal_applying state latency");
+ b.add_time_avg(l_bluestore_state_wal_aio_wait_lat, "state_wal_aio_wait_lat",
+ "Average aio_wait state latency");
+ b.add_time_avg(l_bluestore_state_wal_cleanup_lat, "state_wal_cleanup_lat",
+ "Average cleanup state latency");
+ b.add_time_avg(l_bluestore_state_finishing_lat, "state_finishing_lat",
+ "Average finishing state latency");
+ b.add_time_avg(l_bluestore_state_done_lat, "state_done_lat",
+ "Average done state latency");
+ b.add_time_avg(l_bluestore_compress_lat, "compress_lat",
+ "Average compress latency");
+ b.add_time_avg(l_bluestore_decompress_lat, "decompress_lat",
+ "Average decompress latency");
+ b.add_u64(l_bluestore_compress_success_count, "compress_success_count",
+ "Sum for beneficial compress ops");
+
+ b.add_u64(l_bluestore_write_pad_bytes, "write_pad_bytes",
+ "Sum for write-op padded bytes");
+ b.add_u64(l_bluestore_wal_write_ops, "wal_write_ops",
+ "Sum for wal write op");
+ b.add_u64(l_bluestore_wal_write_bytes, "wal_write_bytes",
+ "Sum for wal write bytes");
+ b.add_u64(l_bluestore_write_penalty_read_ops, " write_penalty_read_ops",
+ "Sum for write penalty read ops");
+ b.add_u64(l_bluestore_allocated, "bluestore_allocated",
+ "Sum for allocated bytes");
+ b.add_u64(l_bluestore_stored, "bluestore_stored",
+ "Sum for stored bytes");
+ b.add_u64(l_bluestore_compressed, "bluestore_compressed",
+ "Sum for stored compressed bytes");
+ b.add_u64(l_bluestore_compressed_allocated, "bluestore_compressed_allocated",
+ "Sum for bytes allocated for compressed data");
+ b.add_u64(l_bluestore_compressed_original, "bluestore_compressed_original",
+ "Sum for original bytes that were compressed");
+
+ b.add_u64(l_bluestore_onode_hits, "bluestore_onode_hits",
+ "Sum for onode-lookups hit in the cache");
+ b.add_u64(l_bluestore_onode_misses, "bluestore_onode_misses",
+ "Sum for onode-lookups missed in the cache");
+ b.add_u64(l_bluestore_buffer_hit_bytes, "bluestore_buffer_hit_bytes",
+ "Sum for bytes of read hit in the cache");
+ b.add_u64(l_bluestore_buffer_miss_bytes, "bluestore_buffer_miss_bytes",
+ "Sum for bytes of read missed in the cache");
logger = b.create_perf_counters();
g_ceph_context->get_perfcounters_collection()->add(logger);
}
cache_shards.resize(num);
for (unsigned i = old; i < num; ++i) {
cache_shards[i] = Cache::create(g_conf->bluestore_cache_type);
+ cache_shards[i]->set_store(this);
}
}