mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-01-18 20:11:20 +00:00
docs/how_tos: Update example workload creation
Clarify the workload creation example.
This commit is contained in:
parent
9b19f33186
commit
2a8454db6a
@ -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
|
you wish to specify a custom location this can be provided with ``-p
|
||||||
<path>``
|
<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-example:
|
||||||
|
|
||||||
Adding a Basic Workload
|
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
|
This will generate a very basic workload with dummy methods for the each method in
|
||||||
interface and it is left to the developer to add any required functionality to
|
the workload interface and it is left to the developer to add any required functionality.
|
||||||
the workload.
|
|
||||||
|
|
||||||
Not all the methods are required to be implemented, this example shows how a
|
Not all the methods from the interface are required to be implemented, this
|
||||||
subset might be used to implement a simple workload that times how long it takes
|
example shows how a subset might be used to implement a simple workload that
|
||||||
to compress a file of a particular size on the device.
|
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
|
.. 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
|
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
|
: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
|
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
|
.. code-block:: python
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from wa import Workload, Parameter
|
from wa import Workload, Parameter
|
||||||
|
|
||||||
class ZipTestWorkload(Workload):
|
class ZipTest(Workload):
|
||||||
|
|
||||||
name = 'ziptest'
|
name = 'ziptest'
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user