#include "include/types.h" #include "include/Distribution.h" #include "osd/OSDMap.h" Distribution file_size_distn; //kb list object_queue; int max_object_size = 1024*1024*100; //kb off_t no; int get_object() //kb { if (object_queue.empty()) { int max = file_size_distn.sample(); no++; int filesize = max/2 + (rand() % 100) * max/200 + 1; //cout << "file " << filesize << endl; while (filesize > max_object_size) { object_queue.push_back(max_object_size); filesize -= max_object_size; } object_queue.push_back(filesize); } int s = object_queue.front(); object_queue.pop_front(); //cout << "object " << s << endl; return s; } void getdist(vector& v, float& avg, float& var) { avg = 0.0; for (int i=0; i pgs(n); off_t did = 0; no = 0; while (did < dist) { off_t s = get_object(); pgs[rand()%n] += s; did += s; } while (!object_queue.empty()) pgs[rand()%n] += get_object(); numo = no; //cout << did/n << endl; //for (int i=0; i