Skip to content

Commit

Permalink
MemcachedBenchmark: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mita committed Jan 20, 2010
1 parent 9bb2b81 commit b6b7c90
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions MemcachedBenchmark.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,6 @@ public class MemcachedBenchmark extends Thread {
public int id;
public long time_ms;

public static void set(MemcachedClient c, String key, byte[] value) {
c.set(key, 1000000, value);
}

public static String get(MemcachedClient c, String key) {
Object value = c.get(key);

return value.toString();
}

public MemcachedBenchmark(int i) {
super();
id = i;
Expand All @@ -33,10 +23,11 @@ public void runBenchmark() throws Exception {
for (long i = 0; i < MemcachedBenchmark.numRequests; i++) {
String key = String.format("%04d-%011d", id, i);
if (MemcachedBenchmark.command == 'w') {
MemcachedBenchmark.set(c, key, value);
c.set(key, 100000, value);
c.waitForQueues(Long.MAX_VALUE, TimeUnit.MILLISECONDS);
} else
MemcachedBenchmark.get(c, key);
} else {
c.get(key);
}
}
c.shutdown(Long.MAX_VALUE, TimeUnit.MILLISECONDS);
}
Expand Down

0 comments on commit b6b7c90

Please sign in to comment.