summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--docker/storperf-master/requirements.pip17
-rw-r--r--docker/storperf-master/rest_server.py63
-rw-r--r--docker/storperf-master/storperf/storperf_master.py4
-rw-r--r--docs/testing/user/test-usage.rst20
4 files changed, 84 insertions, 20 deletions
diff --git a/docker/storperf-master/requirements.pip b/docker/storperf-master/requirements.pip
index a591e84..020a1d5 100644
--- a/docker/storperf-master/requirements.pip
+++ b/docker/storperf-master/requirements.pip
@@ -1,11 +1,10 @@
-pyyaml==3.10
-flask==0.10
-flask_cors==3.0.2
-flask-restful==0.3.5
-flask-restful-swagger==0.19
-flask-swagger==0.2.12
+flask==1.0.2
+flask_cors==3.0.6
+flask-restful==0.3.6
+flask-restful-swagger==0.20.1
+flask-swagger==0.2.13
html2text==2016.1.8
-paramiko==2.0.2
-requests==2.13.0
-scp==0.10.2
+paramiko==2.4.1
+requests==2.19.1
+scp==0.11.0
git+https://gerrit.opnfv.org/gerrit/snaps#egg=snaps
diff --git a/docker/storperf-master/rest_server.py b/docker/storperf-master/rest_server.py
index 9d9b7fa..8544f19 100644
--- a/docker/storperf-master/rest_server.py
+++ b/docker/storperf-master/rest_server.py
@@ -471,6 +471,68 @@ for any single test iteration.
@swagger.model
+class WarmUpModel:
+ resource_fields = {
+ 'target': fields.String
+ }
+
+
+class Initialize(Resource):
+
+ """Disk initialization API"""
+
+ def __init__(self):
+ self.logger = logging.getLogger(__name__)
+
+ @swagger.operation(
+ parameters=[
+ {
+ "name": "body",
+ "description": """Fill the target with random data. If no
+target is specified, it will default to /dev/vdb
+
+"target": The target device or file to fill with random data",
+ """,
+ "required": False,
+ "type": "WarmUpModel",
+ "paramType": "body"
+ }
+ ],
+ type=WorkloadResponseModel.__name__,
+ notes='''Initialize the target device or file by filling it to
+ capacity with random data. This is similar to the jobs API,
+ but does not have a deadline or steady state. It also
+ uses a predefined block size and queue depth.''',
+ responseMessages=[
+ {
+ "code": 200,
+ "message": "Job submitted"
+ },
+ {
+ "code": 400,
+ "message": "Missing configuration data"
+ }
+ ]
+ )
+ def post(self):
+ self.logger.info(request.json)
+
+ try:
+ if (request.json and 'target' in request.json):
+ storperf.filename = request.json['target']
+ storperf.queue_depths = "8"
+ storperf.block_sizes = "8192"
+ storperf.workloads = "_warm_up"
+ job_id = storperf.execute_workloads()
+
+ return jsonify({'job_id': job_id})
+
+ except Exception as e:
+ self.logger.exception(e)
+ abort(400, str(e))
+
+
+@swagger.model
class QuotaModel:
resource_fields = {
@@ -516,6 +578,7 @@ def setup_logging(default_path='logging.json',
api.add_resource(Configure, "/api/v1.0/configurations")
+api.add_resource(Initialize, "/api/v1.0/initializations")
api.add_resource(Quota, "/api/v1.0/quotas")
api.add_resource(Job, "/api/v1.0/jobs")
api.add_resource(Job_v2, "/api/v2.0/jobs")
diff --git a/docker/storperf-master/storperf/storperf_master.py b/docker/storperf-master/storperf/storperf_master.py
index b17dae9..ff2acce 100644
--- a/docker/storperf-master/storperf/storperf_master.py
+++ b/docker/storperf-master/storperf/storperf_master.py
@@ -76,8 +76,8 @@ class StorPerfMaster(object):
self._filename = None
self._deadline = None
self._steady_state_samples = 10
- self._queue_depths = [1, 4, 8]
- self._block_sizes = [512, 4096, 16384]
+ self._queue_depths = "1"
+ self._block_sizes = "4096"
self._workload_modules = []
self._custom_workloads = []
self.slave_info = {}
diff --git a/docs/testing/user/test-usage.rst b/docs/testing/user/test-usage.rst
index ef54b6b..40d54ce 100644
--- a/docs/testing/user/test-usage.rst
+++ b/docs/testing/user/test-usage.rst
@@ -83,28 +83,30 @@ takes a JSON payload as follows.
This call will block until the stack is created, at which point it will return
the OpenStack heat stack id as well as the IP addresses of the slave agents.
-Initialize the Cinder Volumes
+Initialize the Target Volumes
=============================
Before executing a test run for the purpose of measuring performance, it is
-necessary to fill the Cinder volume with random data. Failure to execute this
+necessary to fill the volume or file with random data. Failure to execute this
step can result in meaningless numbers, especially for read performance. Most
Cinder drivers are smart enough to know what blocks contain data, and which do
not. Uninitialized blocks return "0" immediately without actually reading from
the volume.
-Initiating the data fill looks the same as a regular performance test, but uses
-the special workload called "_warm_up". StorPerf will never push _warm_up
-data to the OPNFV Test Results DB, nor will it terminate the run on steady state.
-It is guaranteed to run to completion, which fills 100% of the volume with
+Initiating the data fill behave similarly to a regular performance run, but
+will tag the data with a special workload name called "_warm_up". It is
+designed to run to completion, filling 100% of the specified target with
random data.
-The ReST API is a POST to http://StorPerf:5000/api/v1.0/jobs and
-takes a JSON payload as follows.
+The ReST API is a POST to http://StorPerf:5000/api/v1.0/initializations and
+takes a JSON payload as follows. The body is optional unless your target
+is something other than /dev/vdb. For example, if you want to profile a
+glance ephemeral storage file, you could specify the target as "/filename.dat",
+which is a file that then gets created on the root filesystem.
.. code-block:: json
{
- "workload": "_warm_up"
+ "target": "/dev/vdb"
}
This will return a job ID as follows.