summaryrefslogtreecommitdiffstats
path: root/storperf/workloads
diff options
context:
space:
mode:
authormbeierl <mark.beierl@emc.com>2015-11-23 08:23:47 -0800
committermbeierl <mark.beierl@emc.com>2015-11-23 20:15:59 -0800
commit002920e29d7fa4a28abec96773b470c90bafe55d (patch)
tree893f45209a84f197ef6ec3848ed83fc9df3eab8f /storperf/workloads
parentd480e8746512caf8821c42582e7ab75d25b3127b (diff)
Adding workload modules
Adding the ablity to define workloads in modules which can be referenced from the API. Breaking out the test execution into its own class so it will be easier to support ReST or other interfaces. Added flake8 and code coverage reports where possible to merge and verify jobs Change-Id: Ieb51e4e7e1e989288a6f81f4757709669914a196 JIRA: STORPERF-21 Signed-off-by: mbeierl <mark.beierl@emc.com>
Diffstat (limited to 'storperf/workloads')
-rw-r--r--storperf/workloads/__init__.py0
-rw-r--r--storperf/workloads/_base_workload.py54
-rw-r--r--storperf/workloads/_ssd_preconditioning.py16
-rw-r--r--storperf/workloads/_warm_up.py17
-rw-r--r--storperf/workloads/rr.py16
-rw-r--r--storperf/workloads/rs.py16
-rw-r--r--storperf/workloads/rw.py18
-rw-r--r--storperf/workloads/wr.py16
-rw-r--r--storperf/workloads/ws.py16
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'