diff options
author | 2018-04-20 11:34:41 +0100 | |
---|---|---|
committer | 2018-07-05 08:37:47 +0100 | |
commit | 3aed8d1ad85f8a128a22a0a0f2436eb94562799f (patch) | |
tree | 1b7d26ada395175e5849c794685b7d765924e80c /yardstick/common/messaging | |
parent | 4b957421d071cd5120a6e59b0e3bcba98641833f (diff) |
Add "IterationIPC" runner
"IterationIPC" is a runner that runs a configurable number of times before
it returns. Each iteration has a configurable timeout. The loop control
depends on the feedback received from the running VNFs. The context PIDs
from the VNFs to listen the messages from are given in the scenario
"setup" method.
The MQ consumer, "RunnerIterationIPCConsumer", is subscribed to messages
sent to topic "messaging.TOPIC_TG". The endpoints are defined in the
class "RunnerIterationIPCEndpoint". Three are implemented:
"messaging.TG_METHOD_STARTED", "messaging.TG_METHOD_FINISHED" and
"messaging.TG_METHOD_ITERATION".
JIRA: YARDSTICK-1127
Change-Id: I4b2f11a15ef41e6f3c70bd64188d5c7fbcdb7eed
Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
Diffstat (limited to 'yardstick/common/messaging')
-rw-r--r-- | yardstick/common/messaging/__init__.py | 10 | ||||
-rw-r--r-- | yardstick/common/messaging/payloads.py | 12 |
2 files changed, 18 insertions, 4 deletions
diff --git a/yardstick/common/messaging/__init__.py b/yardstick/common/messaging/__init__.py index f0f012ec3..dc8c51b70 100644 --- a/yardstick/common/messaging/__init__.py +++ b/yardstick/common/messaging/__init__.py @@ -28,9 +28,11 @@ TRANSPORT_URL = (MQ_SERVICE + '://' + MQ_USER + ':' + MQ_PASS + '@' + SERVER + RPC_SERVER_EXECUTOR = 'threading' # Topics. -RUNNER = 'runner' +TOPIC_TG = 'topic_traffic_generator' # Methods. -# RUNNER methods: -RUNNER_INFO = 'runner_info' -RUNNER_LOOP = 'runner_loop' +# Traffic generator consumers methods. Names must match the methods implemented +# in the consumer endpoint class, ``RunnerIterationIPCEndpoint``. +TG_METHOD_STARTED = 'tg_method_started' +TG_METHOD_FINISHED = 'tg_method_finished' +TG_METHOD_ITERATION = 'tg_method_iteration' diff --git a/yardstick/common/messaging/payloads.py b/yardstick/common/messaging/payloads.py index d29d79808..c59c87536 100644 --- a/yardstick/common/messaging/payloads.py +++ b/yardstick/common/messaging/payloads.py @@ -51,3 +51,15 @@ class Payload(object): def dict_to_obj(cls, _dict): """Returns a Payload object built from the dictionary elements""" return cls(**_dict) + + +class TrafficGeneratorPayload(Payload): + """Base traffic generator payload class""" + REQUIRED_FIELDS = { + 'version', # (str) version of the payload transmitted. + 'iteration', # (int) iteration index during the traffic injection, + # starting from 1. + 'kpi' # (dict) collection of KPIs collected from the traffic + # injection. The content will depend on the generator and the + # traffic type. + } |