diff options
Diffstat (limited to 'storperf/workloads')
-rw-r--r-- | storperf/workloads/__init__.py | 0 | ||||
-rw-r--r-- | storperf/workloads/_base_workload.py | 54 | ||||
-rw-r--r-- | storperf/workloads/_ssd_preconditioning.py | 16 | ||||
-rw-r--r-- | storperf/workloads/_warm_up.py | 17 | ||||
-rw-r--r-- | storperf/workloads/rr.py | 16 | ||||
-rw-r--r-- | storperf/workloads/rs.py | 16 | ||||
-rw-r--r-- | storperf/workloads/rw.py | 18 | ||||
-rw-r--r-- | storperf/workloads/wr.py | 16 | ||||
-rw-r--r-- | storperf/workloads/ws.py | 16 |
9 files changed, 169 insertions, 0 deletions
diff --git a/storperf/workloads/__init__.py b/storperf/workloads/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/storperf/workloads/__init__.py diff --git a/storperf/workloads/_base_workload.py b/storperf/workloads/_base_workload.py new file mode 100644 index 0000000..7e13e45 --- /dev/null +++ b/storperf/workloads/_base_workload.py @@ -0,0 +1,54 @@ +############################################################################## +# Copyright (c) 2015 EMC and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +import logging + + +class _base_workload(object): + + def __init__(self): + self.logger = logging.getLogger(__name__) + self.default_filesize = "128M" + self.filename = 'storperf.dat' + self.options = { + 'ioengine': 'libaio', + 'direct': '1', + 'rw': 'read', + 'bs': '4k', + 'iodepth': '1', + 'numjobs': '1', + 'loops': '2', + 'output-format': 'json', + 'status-interval': '60' + } + self.invoker = None + + def execute(self): + args = [] + + if self.filename.startswith("/dev"): + self.options['size'] = "100%" + self.logger.debug( + "Profiling a device, using 100% of " + self.filename) + else: + self.options['size'] = self.default_filesize + self.logger.debug("Profiling a filesystem, using " + + self.default_filesize + " file") + + self.options['filename'] = self.filename + + self.setup() + + for key, value in self.options.iteritems(): + args.append('--' + key + "=" + value) + + self.invoker.execute(args) + + def setup(self): + pass diff --git a/storperf/workloads/_ssd_preconditioning.py b/storperf/workloads/_ssd_preconditioning.py new file mode 100644 index 0000000..66d5fa1 --- /dev/null +++ b/storperf/workloads/_ssd_preconditioning.py @@ -0,0 +1,16 @@ +############################################################################## +# Copyright (c) 2015 EMC and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## +from workloads import _base_workload + + +class _ssd_preconditioning(_base_workload._base_workload): + + def setup(self): + self.options['name'] = 'ssd_preconditioning' + self.options['rw'] = 'write' diff --git a/storperf/workloads/_warm_up.py b/storperf/workloads/_warm_up.py new file mode 100644 index 0000000..8eaa2f1 --- /dev/null +++ b/storperf/workloads/_warm_up.py @@ -0,0 +1,17 @@ +############################################################################## +# Copyright (c) 2015 EMC and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## +from workloads import _base_workload + + +class _warm_up(_base_workload._base_workload): + + def setup(self): + self.options['name'] = 'ssd_preconditioning' + self.options['rw'] = 'randwrite' + self.options['loops'] = '4' diff --git a/storperf/workloads/rr.py b/storperf/workloads/rr.py new file mode 100644 index 0000000..824974d --- /dev/null +++ b/storperf/workloads/rr.py @@ -0,0 +1,16 @@ +############################################################################## +# Copyright (c) 2015 EMC and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## +from workloads import _base_workload + + +class rr(_base_workload._base_workload): + + def setup(self): + self.options['name'] = 'random_read' + self.options['rw'] = 'randread' diff --git a/storperf/workloads/rs.py b/storperf/workloads/rs.py new file mode 100644 index 0000000..92e3ce6 --- /dev/null +++ b/storperf/workloads/rs.py @@ -0,0 +1,16 @@ +############################################################################## +# Copyright (c) 2015 EMC and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## +from workloads import _base_workload + + +class rs(_base_workload._base_workload): + + def setup(self): + self.options['name'] = 'sequential_read' + self.options['rw'] = 'read' diff --git a/storperf/workloads/rw.py b/storperf/workloads/rw.py new file mode 100644 index 0000000..2132a81 --- /dev/null +++ b/storperf/workloads/rw.py @@ -0,0 +1,18 @@ +############################################################################## +# Copyright (c) 2015 EMC and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## +from workloads import _base_workload + + +class rw(_base_workload._base_workload): + + def setup(self): + self.options['name'] = 'random_readwrite' + self.options['rwmixread'] = '70' + self.options['rw'] = 'rw' + self.logger.debug(self.options) diff --git a/storperf/workloads/wr.py b/storperf/workloads/wr.py new file mode 100644 index 0000000..19b2c61 --- /dev/null +++ b/storperf/workloads/wr.py @@ -0,0 +1,16 @@ +############################################################################## +# Copyright (c) 2015 EMC and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## +from workloads import _base_workload + + +class wr(_base_workload._base_workload): + + def setup(self): + self.options['name'] = 'random_write' + self.options['rw'] = 'randwrite' diff --git a/storperf/workloads/ws.py b/storperf/workloads/ws.py new file mode 100644 index 0000000..8ec2ebe --- /dev/null +++ b/storperf/workloads/ws.py @@ -0,0 +1,16 @@ +############################################################################## +# Copyright (c) 2015 EMC and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## +from workloads import _base_workload + + +class ws(_base_workload._base_workload): + + def setup(self): + self.options['name'] = 'sequential_write' + self.options['rw'] = 'write' |