本文整理汇总了C++中Experiment::setReadProb方法的典型用法代码示例。如果您正苦于以下问题:C++ Experiment::setReadProb方法的具体用法?C++ Experiment::setReadProb怎么用?C++ Experiment::setReadProb使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Experiment
的用法示例。
在下文中一共展示了Experiment::setReadProb方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char *argv[]){
if(argc!=2){
cerr<<"Argument 1 required"<<endl;
return -1;
}
if(SRAND_ON){
srand(time(NULL));
}
vector<string> server_list = SERVER_LIST; //{"10.129.26.246:8091", "10.129.28.141:8091", "10.129.26.81:8091"};
vector<string> key = DataSetGenerator::getRandomStrings(DATASET_SIZE,KEY_SIZE);
vector<string> value = DataSetGenerator::getRandomStrings(DATASET_SIZE,VALUE_SIZE);
int thread_count = THREAD_COUNT;
int run_time = RUN_TIME;
vector<string> conn = CONN;
Experiment e = Experiment(key, value, conn, thread_count, run_time,DIST==ZIPF); //vector<string> &k, vector<string> &v, string con, int tc, int rt, int dist
string sep="/";
string DATE=currentDateTime("%Y-%m-%d");
string iter_num = string(argv[1]);
string folder=string(DS)+sep+DATE+sep+"TC"+to_string(thread_count)+sep+iter_num+sep;
cout<<folder<<endl;
system((string("mkdir -p ")+folder).c_str());
SystemMonitor sm(server_list,folder);
// e.setReadProb(0.5);
// e.runExperiment(folder + "RP_"+to_string(e.getReadProb()));
//
// e.setReadProb(1);
// e.runExperiment(folder + "RP_"+to_string(e.getReadProb()));
sm.startMonitoring();
e.setReadProb(READPROB);
e.runExperiment(folder + "RP_"+to_string(e.getReadProb()));
sm.stopMonitoring();
// sm.startMonitoring();
// e.setReadProb(0.95);
// e.runExperiment(folder + "RP_"+to_string(e.getReadProb()));
// sm.stopMonitoring();
// long num_cpus = std::thread::hardware_concurrency();
// string detailes = "CPU count, CPU util, NW rx(KBps), NW tx(KBps), NW util, Mem Size, Mem util, Disk util, Page Faults";
return 0;
}