diff options
author | Kali Kaneko <kali@leap.se> | 2016-04-18 11:32:18 -0400 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2016-04-18 11:32:18 -0400 |
commit | bc465c34afe6e86b7fc8d7c690b76aa5e23d6a13 (patch) | |
tree | bf5bdeb244fe4569336ee48b32cb4db0d727c373 /scripts/profiling/sync/profile-sync.py | |
parent | 55548cf947966bcbb9a496e523a3f802b0f0b55f (diff) | |
parent | d5974f61df6ca640dde69903976d4721b6d88007 (diff) |
Merge tag '0.8.0'
Tag soledad version 0.8.0
Diffstat (limited to 'scripts/profiling/sync/profile-sync.py')
-rwxr-xr-x | scripts/profiling/sync/profile-sync.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/scripts/profiling/sync/profile-sync.py b/scripts/profiling/sync/profile-sync.py index 9ef2ea92..8c18bde8 100755 --- a/scripts/profiling/sync/profile-sync.py +++ b/scripts/profiling/sync/profile-sync.py @@ -57,15 +57,17 @@ def create_docs(soledad, args): bail('--payload-file does not exist!') return - numdocs = args.send_num - docsize = args.send_size + numdocs = int(args.send_num) + docsize = int(args.send_size) # XXX this will FAIL if the payload source is smaller to size * num # XXX could use a cycle iterator with open(sample_path, "r+b") as sample_f: fmap = mmap.mmap(sample_f.fileno(), 0, prot=mmap.PROT_READ) + payload = fmap.read(docsize * 1024) for index in xrange(numdocs): - payload = fmap.read(docsize * 1024) + if not args.repeat_payload: + payload = fmap.read(docsize * 1024) s.create_doc({payload: payload}) # main program @@ -95,6 +97,9 @@ if __name__ == '__main__': '--send-num', dest='send_num', default=10, help='number of docs to send (default: 10)') parser.add_argument( + '--repeat-payload', dest='repeat_payload', action='store_true', + default=False) + parser.add_argument( '--payload-file', dest="payload_f", default=None, help='path to a sample file to use for the payloads') parser.add_argument( |