mirror of https://github.com/apache/druid.git
Merge branch 'master' of github.com:metamx/druid
This commit is contained in:
commit
135474e49e
|
@ -56,7 +56,7 @@ public class MemcachedCacheBrokerBenchmark extends SimpleBenchmark
|
||||||
broker = new MemcachedCacheBroker(
|
broker = new MemcachedCacheBroker(
|
||||||
client,
|
client,
|
||||||
500, // 500 milliseconds
|
500, // 500 milliseconds
|
||||||
3600 * 24 * 365 // 1 year
|
3600 // 1 hour
|
||||||
);
|
);
|
||||||
|
|
||||||
cache = broker.provideCache("default");
|
cache = broker.provideCache("default");
|
||||||
|
@ -84,15 +84,17 @@ public class MemcachedCacheBrokerBenchmark extends SimpleBenchmark
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public byte[] timeGetObject(int reps) {
|
public long timeGetObject(int reps) {
|
||||||
byte[] bytes = null;
|
byte[] bytes = null;
|
||||||
|
long count = 0;
|
||||||
for (int i = 0; i < reps; i++) {
|
for (int i = 0; i < reps; i++) {
|
||||||
for(int k = 0; k < objectCount; ++k) {
|
for(int k = 0; k < objectCount; ++k) {
|
||||||
String key = BASE_KEY + i;
|
String key = BASE_KEY + i;
|
||||||
bytes = cache.get(key.getBytes());
|
bytes = cache.get(key.getBytes());
|
||||||
|
count += bytes.length;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return bytes;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
|
|
Loading…
Reference in New Issue