Skip to content

Commit df432b8

Browse files
Add files via upload
1 parent fa197ec commit df432b8

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

wellcoordination/benchmark/rubis-benchmark.cpp

+9-12
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
int main(int argc, char* argv[]) {
1919
std::string loc =
20-
"/home/prithviraj/Documents/Hamband/wellcoordination/workload/";
20+
"/home/pyuvaraj/";
2121

2222
int nr_procs = static_cast<int>(std::atoi(argv[1]));
2323
int num_ops = static_cast<int>(std::atoi(argv[2]));
@@ -94,11 +94,11 @@ int main(int argc, char* argv[]) {
9494
int count = 0;
9595
for (; count < expected_calls_per_update_method;) {
9696
// storeBuyNow
97-
// Sell items with id 0 - 99.
97+
// Buy items with id 0 - 99. 0-5
9898
std::string callStr;
9999
if (type == 0) {
100100
std::string i_id = std::to_string(std::rand() % 100);
101-
std::string value = std::to_string(std::rand() % 1000);
101+
std::string value = std::to_string(std::rand() % 5);
102102
callStr = "1 " + i_id + "-" + value;
103103
}
104104
MethodCall call = ReplicatedObject::createCall("id", callStr);
@@ -136,8 +136,6 @@ int main(int argc, char* argv[]) {
136136
for (int type = 0; type <= 1; type++) {
137137
int count = 0;
138138
for (; count < expected_calls_per_update_method;) {
139-
// registerUser
140-
// add users from 100 - 199.
141139
std::string callStr;
142140
if (type == 0) {
143141
// placeBid
@@ -150,11 +148,11 @@ int main(int argc, char* argv[]) {
150148
}
151149
if (type == 1) {
152150
//Close Auctions
153-
std::string i_id = std::to_string(100 + std::rand() % 100); //auction id
151+
std::string i_id = std::to_string(std::rand() % 100); //auction id
154152
//std::string stock = std::to_string(1 + std::rand() % 1000); //stock
155153

156154
//open[i - 1].push_back(i_id);
157-
callStr = "5 " + i_id
155+
callStr = "5 " + i_id;
158156
}
159157
MethodCall call = ReplicatedObject::createCall("id", callStr);
160158
if (test->isPermissible(call)) {
@@ -173,12 +171,11 @@ int main(int argc, char* argv[]) {
173171
expected_nonconflicting_write_calls_per_follower; count++) {
174172
std::string callStr;
175173
if (type == 0) {
176-
// sellitem
177-
std::string s_id = std::to_string(100 + std::rand() % 100);
178-
std::string value = std::to_string(std::rand() % 1000);
179-
callStr = "0 " + s_id+ "-"+ value;
174+
// sellitem
175+
std::string s_id = std::to_string(100 + std::rand() % 100);
176+
std::string value = std::to_string(std::rand() % 1000);
177+
callStr = "0 " + s_id+ "-"+ value;
180178
}
181-
182179
if (type == 1) {
183180
//Open Auctions
184181
// Open 100 - 199, with different stock values

wellcoordination/benchmark/rubis.hpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ class Rubis : public ReplicatedObject
8080
synch_groups.push_back(g3);
8181

8282
for (int i = 0; i < 100; i++) {
83-
directbuysell[i] = 1000;
83+
directbuysell[i] = 1000;
84+
openauctions.insert(i);
8485
registeredusers.insert(i);
8586
}
8687
}

0 commit comments

Comments
 (0)