forked from ziyueqiu/FrozenHot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_trace.cpp
More file actions
58 lines (46 loc) · 1.62 KB
/
Copy pathtest_trace.cpp
File metadata and controls
58 lines (46 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#include "ssdlogging/util.h"
#include "traceloader/client.h"
#include <functional>
#include <thread>
#include "ssdlogging/properties.h"
void ParseCommandLine(int argc, const char *argv[], utils::Properties &props);
int main(const int argc, const char *argv[]){
utils::Properties props;
ParseCommandLine(argc, argv, props);
printf("Warmup\n");
auto client = new Client(props);
client->warmup();
delete client;
}
void ParseCommandLine(int argc, const char *argv[], utils::Properties &props) {
// <threads num> <cache size> <request num> <seg num> <workload type>
// <workload file or Zipf const> <cache type> <disk lat>
if(argc != 10 && argc != 12){
printf("argc = %d\n", argc);
printf("usage:<threads num> <cache size> <request num> <seg num> <workload type> <workload file prefix or Zipf const> <cache type> <disk lat> [workload start] [workload end]\n");
exit(0);
}
std::ifstream input(argv[1]);
//1. threads number
props.SetProperty("threads num", argv[1]);
//2. cache size
props.SetProperty("cache size", argv[2]);
//3. request num
props.SetProperty("request num", argv[3]);
//4. seg num
props.SetProperty("seg num", argv[4]);
//5. workload type
props.SetProperty("workload type", argv[5]);
//6. workload file 1
props.SetProperty("workload file or zipf const", argv[6]);
//7. cache type
props.SetProperty("cache type", argv[7]);
//8. disk lat
props.SetProperty("disk lat", argv[8]);
//9. rebuild frequency (0 for baseline, useless)
props.SetProperty("rebuild freq", argv[9]);
if(argc == 12) {
props.SetProperty("workload start", argv[10]);
props.SetProperty("workload end", argv[11]);
}
}