1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-01-18 12:06:08 +00:00

docs/how_tos: Update example workload creation

Clarify the workload creation example.
This commit is contained in:
Marc Bonnici 2020-04-27 12:26:48 +01:00 committed by setrofim
parent 9b19f33186
commit 2a8454db6a

View File

@ -58,22 +58,28 @@ will automatically generate a workload in the your ``WA_CONFIG_DIR/plugins``. If
you wish to specify a custom location this can be provided with ``-p
<path>``
A typical invocation of the :ref:`create <create-command>` command would be in
the form::
wa create workload -k <workload_kind> <workload_name>
.. _adding-a-basic-workload-example:
Adding a Basic Workload
-----------------------
To add a basic workload you can simply use the command::
To add a ``basic`` workload template for our example workload we can simply use the
command::
wa create workload basic
wa create workload -k basic ziptest
This will generate a very basic workload with dummy methods for the workload
interface and it is left to the developer to add any required functionality to
the workload.
This will generate a very basic workload with dummy methods for the each method in
the workload interface and it is left to the developer to add any required functionality.
Not all the methods are required to be implemented, this example shows how a
subset might be used to implement a simple workload that times how long it takes
to compress a file of a particular size on the device.
Not all the methods from the interface are required to be implemented, this
example shows how a subset might be used to implement a simple workload that
times how long it takes to compress a file of a particular size on the device.
.. note:: This is intended as an example of how to implement the Workload
@ -87,14 +93,15 @@ in this example we are implementing a very simple workload and do not
require any additional feature so shall inherit directly from the the base
:class:`Workload` class. We then need to provide a ``name`` for our workload
which is what will be used to identify your workload for example in an
agenda or via the show command.
agenda or via the show command, if you used the `create` command this will
already be populated for you.
.. code-block:: python
import os
from wa import Workload, Parameter
class ZipTestWorkload(Workload):
class ZipTest(Workload):
name = 'ziptest'