// an approximation for actually stored user data
auto stored_normalized = pool_stat.get_user_bytes(raw_used_rate, per_pool,
per_pool_omap);
+ // same, amplied by replication or EC
+ auto stored_raw = stored_normalized * raw_used_rate;
if (f) {
f->dump_int("stored", stored_normalized);
f->dump_int("objects", sum.num_objects);
f->dump_int("compress_bytes_used", statfs.data_compressed_allocated);
f->dump_int("compress_under_bytes", statfs.data_compressed_original);
// Stored by user amplified by replication
- f->dump_int("stored_raw", pool_stat.get_user_bytes(1.0, per_pool,
- per_pool_omap));
+ f->dump_int("stored_raw", stored_raw);
}
} else {
tbl << stringify(byte_u_t(stored_normalized));
}
return allocated_bytes;
}
- uint64_t get_user_bytes(float raw_used_rate, bool per_pool,
+ uint64_t get_user_bytes(float raw_used_rate, ///< space amp factor
+ bool per_pool,
bool per_pool_omap) const {
+ // NOTE: we need the space amp factor so that we can work backwards from
+ // the raw utilization to the amount of data that the user actually stored.
uint64_t user_bytes;
if (per_pool) {
user_bytes = raw_used_rate ? store_stats.data_stored / raw_used_rate : 0;
} else {
- // legacy mode, use numbers from 'stats'
- user_bytes = stats.sum.num_bytes +
- stats.sum.num_bytes_hit_set_archive;
+ // legacy mode, use numbers from 'stats'. note that we do NOT use the
+ // raw_used_rate factor here because we are working from the PG stats
+ // directly.
+ user_bytes = stats.sum.num_bytes + stats.sum.num_bytes_hit_set_archive;
}
if (per_pool_omap) {
user_bytes += store_stats.omap_allocated;