Commit 2b3a4fc1 authored by David Auer's avatar David Auer
Browse files

Add aged config benchmark

parent 3e69a36f
Loading
Loading
Loading
Loading
+17 −2
Original line number Diff line number Diff line
@@ -663,7 +663,7 @@ main(int argc, const char* argv[]) {
    return 0;
}

// TODO(dauer) move this to it's own file
// TODO(dauer) move this to its own file

#include <chrono>

@@ -729,11 +729,26 @@ benchmark(string selector, long host_count) {
    for(size_t i = 0; i < host_count; i++) {
        disks.emplace_back(new VDRIVE::Disk(i, 1, "hostname", "uri"));
    }
    long next_host_id = host_count;
    rs_dist->addDisks(&disks);


    if(agedconf) {
        // do some iterations of add/remove with rs_dist
        std::vector<uint64_t> disk_ids{};
        for(int age_rounds = 0; age_rounds < 10; age_rounds++) {
            while(disks.size() > 0) {
                delete disks.back();
                disks.pop_back();
            }
            for(size_t i = 0; i < host_count; i++) {
                disks.emplace_back(
                        new VDRIVE::Disk(next_host_id, 1, "hostname", "uri"));
                disk_ids.emplace_back(next_host_id);
                next_host_id++;
            }
            rs_dist->addDisks(&disks);
        }
        rs_dist->removeDisks(disk_ids);
    }

    if(randomslicing) {