Tweaking per-obj fragmentation score

Signed-off-by: Tri Dao <daominhtri0503@gmail.com>
This commit is contained in:
tridao 2023-07-03 19:28:46 -03:00
parent 0956ff67ea
commit d83c5a73eb
2 changed files with 6 additions and 6 deletions

View File

@ -121,12 +121,12 @@ void ObjectStoreImitator::Object::append(PExtentVector &ext, uint64_t offset) {
}
void ObjectStoreImitator::Object::verify_extents() {
std::cout << "Verifying extents:\n";
// std::cout << "Verifying extents:\n";
uint64_t prev{0};
for (auto &[l_off, ext] : extent_map) {
std::cout << "logical offset: " << l_off
<< ", extent offset: " << ext.offset
<< ", extent length: " << ext.length << std::endl;
// std::cout << "logical offset: " << l_off
// << ", extent offset: " << ext.offset
// << ", extent length: " << ext.length << std::endl;
ceph_assert(ext.is_valid());
ceph_assert(ext.length > 0);
@ -176,7 +176,7 @@ void ObjectStoreImitator::print_per_object_fragmentation() {
double coll_total{0};
for (auto &[id, obj] : coll_ref->objects) {
double frag_score{1};
unsigned i{2};
unsigned i{1};
uint64_t ext_size = 0;
PExtentVector extents;

View File

@ -221,7 +221,7 @@ public:
// Generate metrics for per-object fragmentation (how fragmented are each
// object's extents), defined by: frag_score = 1 - sum((size proportion of
// each extents / object size) ^ index of each extent in a vector sorted by
// descending length + 1). This should only be called after the generators
// descending length). This should only be called after the generators
// are finished as it will attempt to change an object's extents.
void print_per_object_fragmentation();