Permalink
Browse files

A trace player.

  • Loading branch information...
1 parent c423a89 commit 60055cb90a7629426f3418426aacffd495ab0b71 @rescrv committed Jan 25, 2012
Showing with 467 additions and 1 deletion.
  1. +13 −1 Makefile.am
  2. +19 −0 gentrace.py
  3. +435 −0 trace-player.cc
View
@@ -61,7 +61,8 @@ noinst_HEADERS = \
$(libhyperdaemon_noinst_headers)
bin_PROGRAMS = \
- daemon
+ daemon \
+ trace-player
noinst_PROGRAMS = \
$(libhyperspacehashing_noinst_programs) \
@@ -452,6 +453,17 @@ replication_stress_test_LDADD = \
replication_stress_test_LDFLAGS = \
-no-install
+trace_player_SOURCES = \
+ trace-player.cc
+trace_player_LDADD = \
+ -lbsd \
+ $(HYPERSPACEHASHING_LDADD) \
+ $(HYPERCLIENT_LDADD) \
+ libhyperspacehashing.la \
+ libhyperclient.la
+trace_player_LDFLAGS = \
+ -no-install
+
################################################################################
################################### Coverage ###################################
################################################################################
View
@@ -0,0 +1,19 @@
+import math
+import random
+import string
+
+charset = string.ascii_letters + string.digits
+
+NUMOPS = 1000000
+PERCGET = 0.95
+
+keys = []
+
+for i in range(NUMOPS):
+ if keys and random.random() < PERCGET:
+ print 'GET', random.choice(keys)
+ else:
+ key = ''.join([random.choice(charset) for i in range(8)])
+ value = ''.join([random.choice(charset) for i in range(64)])
+ keys.append(key)
+ print 'PUT', key, 'value', value
Oops, something went wrong.

0 comments on commit 60055cb

Please sign in to comment.