forked from sharathvemula/waffle_test
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8d824b6
commit 6234487
Showing
27 changed files
with
15,000,308 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
51 changes: 51 additions & 0 deletions
51
waffleClient/tracefiles/0.85/workloada/genProxyBenchmark.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#include <iostream> | ||
#include <fstream> | ||
#include <string> | ||
#include <sstream> | ||
#include <stdio.h> | ||
#include <cstring> | ||
|
||
using namespace std; | ||
|
||
int main() { | ||
std::string input_file_name = "/home/svemula/traceFiles/0.85/workloada/runKeys.txt"; | ||
std::string output_file_name = "/home/svemula/traceFiles/0.85/workloada/proxy_benchmark_command_line_input.txt"; | ||
std::ifstream input_file(input_file_name); | ||
std::ofstream output_file(output_file_name, std::ios::out); | ||
|
||
if (input_file.is_open() && output_file.good()) { | ||
std::string line; | ||
while (std::getline(input_file, line)) { | ||
std::istringstream iss(line); | ||
std::string type; | ||
std::string value = ""; | ||
std::string key; | ||
while(1) { | ||
iss >> type; | ||
//cout << "Type is " << type << endl; | ||
if(strcmp(type.c_str(),"\"HMSET\"") == 0) { | ||
iss >> key; | ||
key.pop_back(); | ||
key.erase(0, 1); | ||
value = "test_value"; | ||
output_file << "SET " << key << " " << value << "\n"; | ||
break; | ||
} else if(strcmp(type.c_str(),"\"HGETALL\"") == 0) { | ||
iss >> key; | ||
key.pop_back(); | ||
key.erase(0, 1); | ||
output_file << "GET " << key << "\n"; | ||
break; | ||
} | ||
} | ||
|
||
} | ||
input_file.close(); | ||
output_file.close(); | ||
std::cout << "File copy successful!" << std::endl; | ||
} else { | ||
std::cout << "Failed to open files!" << std::endl; | ||
} | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#include <iostream> | ||
#include <fstream> | ||
#include <string> | ||
|
||
int main() { | ||
std::string input_file_name = "/home/svemula/traceFiles/0.85/workloada/proxyServerTraceFile.txt"; | ||
std::string output_file_name = "/home/svemula/traceFiles/0.85/workloada/proxy_server_command_line_input.txt"; | ||
std::ifstream input_file(input_file_name); | ||
std::ofstream output_file(output_file_name, std::ios::out); | ||
|
||
if (input_file.is_open() && output_file.good()) { | ||
std::string line; | ||
while (std::getline(input_file, line)) { | ||
output_file << "SET " << line << " test" << "\n"; | ||
} | ||
input_file.close(); | ||
output_file.close(); | ||
std::cout << "File copy successful!" << std::endl; | ||
} else { | ||
std::cout << "Failed to open files!" << std::endl; | ||
} | ||
|
||
return 0; | ||
} |
Oops, something went wrong.