Skip to content

Commit

Permalink
Uploading tracefiles
Browse files Browse the repository at this point in the history
  • Loading branch information
sharathvemula committed Apr 27, 2023
1 parent 8d824b6 commit 6234487
Show file tree
Hide file tree
Showing 27 changed files with 15,000,308 additions and 0 deletions.
Binary file added .DS_Store
Binary file not shown.
Binary file added ._.DS_Store
Binary file not shown.
Binary file added waffleClient/tracefiles/0.85/workloada/a.out
Binary file not shown.
51 changes: 51 additions & 0 deletions waffleClient/tracefiles/0.85/workloada/genProxyBenchmark.cpp
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;
}
24 changes: 24 additions & 0 deletions waffleClient/tracefiles/0.85/workloada/genproxyServer.cpp
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;
}
Loading

0 comments on commit 6234487

Please sign in to comment.