diff options
author | Lars Wirzenius <liw@liw.fi> | 2012-05-24 13:05:10 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2012-05-24 13:05:10 +0200 |
commit | 7d31a77452343b0bb095a18444446eb1f48affdc (patch) | |
tree | d591de1dd0e639ac6918e067ab0036385a9671e4 | |
parent | 4e41b9527fdfe50145e5a891200e80224269cf53 (diff) | |
parent | fb6173dc57a6b00051dbcfa1e481fec8e0e1e141 (diff) | |
download | obnam-7d31a77452343b0bb095a18444446eb1f48affdc.tar.gz |
Re-invent obnam standard benchmarks
-rw-r--r-- | confs/benchmark-std-1.conf | 3 | ||||
-rw-r--r-- | confs/benchmark-std-2.conf | 3 | ||||
-rw-r--r-- | confs/benchmark-std-3.conf | 5 | ||||
-rw-r--r-- | confs/common.conf | 3 | ||||
-rw-r--r-- | confs/historical-local.conf | 4 | ||||
-rw-r--r-- | confs/media-local.conf | 5 | ||||
-rw-r--r-- | confs/sourcecode-local.conf | 5 | ||||
-rwxr-xr-x | obnam-benchmark | 119 | ||||
-rwxr-xr-x | run-benchmarks | 10 |
9 files changed, 73 insertions, 84 deletions
diff --git a/confs/benchmark-std-1.conf b/confs/benchmark-std-1.conf deleted file mode 100644 index b530c325..00000000 --- a/confs/benchmark-std-1.conf +++ /dev/null @@ -1,3 +0,0 @@ -[config] -use-sftp-repository = false - diff --git a/confs/benchmark-std-2.conf b/confs/benchmark-std-2.conf deleted file mode 100644 index 89b019b5..00000000 --- a/confs/benchmark-std-2.conf +++ /dev/null @@ -1,3 +0,0 @@ -[config] -use-sftp-repository = true - diff --git a/confs/benchmark-std-3.conf b/confs/benchmark-std-3.conf deleted file mode 100644 index f776e7c6..00000000 --- a/confs/benchmark-std-3.conf +++ /dev/null @@ -1,5 +0,0 @@ -[config] -size = 1k/1k -generations = 100 -use-sftp-repository = no - diff --git a/confs/common.conf b/confs/common.conf index ffd2a424..08a3c859 100644 --- a/confs/common.conf +++ b/confs/common.conf @@ -1,3 +1,2 @@ [config] -size = 10m/1m -seivot-branch = /home/liw/seivot/trunk +with-encryption = yes diff --git a/confs/historical-local.conf b/confs/historical-local.conf new file mode 100644 index 00000000..e1288415 --- /dev/null +++ b/confs/historical-local.conf @@ -0,0 +1,4 @@ +[config] +profile-name = historical-local +size = 4k/4k +generations = 1000 diff --git a/confs/media-local.conf b/confs/media-local.conf new file mode 100644 index 00000000..5f51ec87 --- /dev/null +++ b/confs/media-local.conf @@ -0,0 +1,5 @@ +[config] +profile-name = media-local +size = 1g/100m +file-size = 100m +generations = 2 diff --git a/confs/sourcecode-local.conf b/confs/sourcecode-local.conf new file mode 100644 index 00000000..0cb5919f --- /dev/null +++ b/confs/sourcecode-local.conf @@ -0,0 +1,5 @@ +[config] +profile-name = sourcecode-local +size = 1g/10m +file-size = 16k +generations = 2 diff --git a/obnam-benchmark b/obnam-benchmark index c764244e..68057a02 100755 --- a/obnam-benchmark +++ b/obnam-benchmark @@ -33,11 +33,6 @@ class ObnamBenchmark(cliapp.Application): keyid = '3B1802F81B321347' opers = ('backup', 'restore', 'list_files', 'forget') - profiles = { - 'mailspool': 4096, - 'mediaserver': 100 * 1024**2, - } - def add_settings(self): self.settings.string(['results'], 'put results under DIR (%default)', metavar='DIR', default='../benchmarks') @@ -57,17 +52,19 @@ class ObnamBenchmark(cliapp.Application): self.settings.boolean(['with-encryption'], 'run benchmark using encryption') + self.settings.string(['profile-name'], + 'short name for benchmark scenario', + default='unknown') self.settings.string_list(['size'], 'add PAIR to list of sizes to ' 'benchmark (e.g., 10g/1m)', metavar='PAIR') + self.settings.bytesize(['file-size'], 'how big should files be?', + default=4096) self.settings.integer(['generations'], 'benchmark N generations (default: %default)', metavar='N', default=5) - self.settings.string(['use-existing'], - 'use existing DIR for initial generation', - metavar='DIR') self.settings.boolean(['use-sftp-repository'], 'access the repository over SFTP ' '(requires ssh to localhost to work)') @@ -105,65 +102,53 @@ class ObnamBenchmark(cliapp.Application): sizes = self.settings['size'] or self.default_sizes logging.debug('sizes: %s' % repr(sizes)) - - if self.settings['use-existing']: - profiles = sorted(('existing+%s' % name, size) - for name, size in self.profiles.iteritems()) - else: - profiles = sorted(self.profiles.iteritems()) - - for profile, file_size in profiles: - for pair in sizes: - initial, inc = self.parse_size_pair(pair) - - msg = 'Profile %s, size %s inc %s' % (profile, initial, inc) - print - print msg - print '-' * len(msg) - print - - obnam_profile = os.path.join(results, - 'obnam-' + initial + - '-' + profile + - '-%(op)s-%(gen)s.prof') - output = os.path.join(results, - 'obnam-%s-%s.seivot' % - (initial, profile)) - if os.path.exists(output): - print ('%s already exists, not re-running benchmark' % - output) - else: - argv = [seivot, - '--obnam-branch', obnam_branch, - '--larch-branch', larch_branch, - '--incremental-data', inc, - '--file-size', str(file_size), - '--obnam-profile', obnam_profile, - '--generations', str(generations), - '--profile-name', profile, - '--sftp-delay', str(self.settings['sftp-delay']), - '--output', output] - if self.settings['seivot-log']: - argv.extend(['--log', self.settings['seivot-log']]) - if self.settings['drop-caches']: - argv.append('--drop-caches') - if self.settings['use-existing']: - argv.extend(['--use-existing', - self.settings['use-existing']]) - else: - argv.extend(['--initial-data', initial]) - if self.settings['use-sftp-repository']: - argv.append('--use-sftp-repository') - if self.settings['use-sftp-root']: - argv.append('--use-sftp-root') - if self.settings['with-encryption']: - argv.extend(['--encrypt-with', self.keyid]) - if self.settings['description']: - argv.extend(['--description', - self.settings['description']]) - if self.settings['verify']: - argv.append('--verify') - self.runcmd(argv, env=env) + + file_size = self.settings['file-size'] + profile_name = self.settings['profile-name'] + + for pair in sizes: + initial, inc = self.parse_size_pair(pair) + + msg = 'Profile %s, size %s inc %s' % (profile_name, initial, inc) + print + print msg + print '-' * len(msg) + print + + obnam_profile = os.path.join(results, + 'obnam--%(op)s-%(gen)s.prof') + output = os.path.join(results, 'obnam.seivot') + if os.path.exists(output): + print ('%s already exists, not re-running benchmark' % + output) + else: + argv = [seivot, + '--obnam-branch', obnam_branch, + '--larch-branch', larch_branch, + '--incremental-data', inc, + '--file-size', str(file_size), + '--obnam-profile', obnam_profile, + '--generations', str(generations), + '--profile-name', profile_name, + '--sftp-delay', str(self.settings['sftp-delay']), + '--initial-data', initial, + '--output', output] + if self.settings['seivot-log']: + argv.extend(['--log', self.settings['seivot-log']]) + if self.settings['drop-caches']: + argv.append('--drop-caches') + if self.settings['use-sftp-repository']: + argv.append('--use-sftp-repository') + if self.settings['use-sftp-root']: + argv.append('--use-sftp-root') + if self.settings['with-encryption']: + argv.extend(['--encrypt-with', self.keyid]) + if self.settings['description']: + argv.extend(['--description', + self.settings['description']]) + if self.settings['verify']: + argv.append('--verify') + self.runcmd(argv, env=env) shutil.rmtree(tempdir) diff --git a/run-benchmarks b/run-benchmarks index 58246c89..46dead16 100755 --- a/run-benchmarks +++ b/run-benchmarks @@ -17,9 +17,11 @@ set -ue -for x in confs/benchmark-std-*.conf +for x in confs/*.conf do - echo "===== $x" - ./obnam-benchmark --no-default-config --config=confs/common.conf \ - --config="$x" "$@" + if [ "$x" != confs/common.conf ] + then + ./obnam-benchmark --no-default-config --config=confs/common.conf \ + --config="$x" "$@" + fi done |