Commit Graph

32 Commits

Author SHA1 Message Date
Ilya Shakhat
55882795f0 Simulator: store results in JSON format
This patch introduces new parameter --json <file name>.
When it is specified the simulator stores stats in JSON file.

Change-Id: I0b7a87ee614f44baa920569fe0c7046269c90925
2016-03-10 19:23:35 +03:00
Ilya Shakhat
84109fe8fc Simulator: calculate message latency statistics
Calculate message latency: for RPC calls on both server-side and
on client-side (round-trip); for RPC cast and NOTIFY on server-side
only.

The message is extended with metadata: sequence id, creation time,
reception time and return time (for RPC calls). For every message
the metadata is stored into MessageStatCollector. To reduce memory
consumption the collector aggregates stats on every second and can
print the ongoing stats to stdout. At the finish the overall stats
are printed.

NOTIFY tests are changed to be similar to RPC:
 * use pre-generated messages
 * parameter "-w WAIT_BEFORE_ANSWER" for processing delay
 * parameter "--requeue" to re-queue new messages (only those that
   miss the cache)

Change-Id: I4c2fc11bfaee17b6825cdc7d6edf07b8e91ef83a
2016-03-10 13:52:58 +03:00
Ilya Shakhat
37c0db5769 Simulator: always use random messages for time-bound tests
When the test is time-bound the simulator should use as many random
messages as possible.

Change-Id: I1e112d9ff0c3f1281b544f05d25eff2d3912fd6c
2016-03-03 13:57:41 +03:00
Ilya Shakhat
97385ef5b5 Simulator: implement own random generator instead of scipy
Dependency on scipy results in extra requirements to the system
(include the need of Fortran compiler). With this patch the
weighted random choice algorithm is implemented directly.

Change-Id: I60cbc6c452945000add5a65263d1ab4e42dd91f9
2016-03-02 19:06:16 +03:00
Ilya Shakhat
d2496c34d9 Simulator: fix batch-notify-server command
This patch fixes the name of parameters used to construct
batch notification listener

Change-Id: I8eae9494943b2592c9cf4b92fccca93eab3b8e93
2016-03-02 18:28:11 +03:00
ozamiatin
681f631123 Make simulator more asynchronous
We need to use eventlet.sleep() in green thread loops
in order to have more chances to switch between them.

Change-Id: I7c08e82182b68b95c36265d58df0644c5ce2c171
2016-02-26 13:15:00 +02:00
Yulia Portnova
d70dfc2f7e Added duration to notify server/client
Change-Id: I4feeeec0c69305d92dce5baf60502a39ebe6b247
2016-02-24 11:58:12 +03:00
Davanum Srinivas
11f78de5f0 Avoid hardcoding the notification topic and specify driver
"n-t1" as notification topic not really useful. Let's allow
it to be specified from the command line. Also make sure
we set the notification driver as "messaging" by default

Change-Id: I5daf09b9a01e4d642b0f53d7634d5b305d5a82cb
2016-02-22 16:07:30 -08:00
Yulia Portnova
c10ee15fe0 Log format change in simulator.py
Change-Id: I046717f9ea7f203f7e5837c7b62a6a7d7cc7bb4d
2016-02-18 13:43:38 +02:00
Jenkins
b80fdc850d Merge "simulator.py improvements" 2016-02-15 13:32:49 +00:00
Yulia Portnova
3c0a48aace simulator.py improvements
Added fanout option to target
Fixed timeout option
Removed setting config values as they are
reverted to defaults on driver load

Change-Id: Ia2d8a7bbcb04706deb3d701c1a0f93a0dd835a19
2016-02-15 10:38:47 +02:00
Javeme
668062ed07 Use more secure yaml.safe_load() instead of yaml.load()
The function yaml.load() provides the ability to construct an arbitrary
Python object. For security, we use yaml.safe_load() instead which
limits this ability to simple Python objects(like integers or lists).

ref: https://en.wikipedia.org/wiki/YAML#Security

Change-Id: Iea2a2d79c764d635b02c5d6d36c9a5652010d716
2016-02-11 14:35:24 +08:00
Yulia Portnova
062fedccd0 Improve simulator.py
* passing targets to rpc-client using -tg arg
so clients can send messages to different targets
* removed redis.flush_db() so we can start
several simulator processes for zmq.

Change-Id: I0d36c5d8cbec938c8fd85d1041d2a3bff02b49e5
2016-01-27 13:08:24 +02:00
Javeme
6e2f4efb19 replace string format arguments with function parameters
There are files containing string format arguments inside
logging messages. Using logging function parameters should
be preferred.

Change-Id: Iaa15bc52d1d8832032cc46205effb49630cea494
Closes-Bug: #1321274
2016-01-22 20:36:43 +08:00
Jenkins
2ae5196747 Merge "py3: Replaces xrange() with six.moves.range()" 2016-01-21 07:57:28 +00:00
Yulia Portnova
39729e423d Logging rpc client/server targets
Change-Id: Ief8cb50af58bba886cb02c309b8254ffc685c5cc
2016-01-18 14:36:50 +02:00
Yulia Portnova
9880765419 Topic/server arguments changed in simulator.py
passing config with --config-file
passing list of topics to use with -tp arg;
passing server name with -s arg

Change-Id: I8dcce9e725117f8a046135b94d8d2047d24bbf76
2016-01-15 18:19:56 +02:00
Javeme
5ff2dfcbb7 py3: Replaces xrange() with six.moves.range()
Since xrange has been removed in Python 3, this patch let's replace xrange()
with six.moves.range() to provide py3 compatibility.

Change-Id: I85e0748786867334756a51dcb834f84ffd1e55a7
2016-01-14 18:05:24 +08:00
Yulia Portnova
2c8f39312f Add duration option to simulator.py
Change-Id: I992fdc1e22ee0debed34b4beb62cbd563351d12f
2016-01-11 18:46:40 +02:00
Konstantin Kalin
2251966c99 Optimize simulator.py for better throughput
* Avoid string concatenation during logging, especially
  when logging level is disabled.
* Initialize the Randomized strings we will be using
  as payloads *before* we start sending the messages
  as the string creation takes time and reduces
  throughput

Change-Id: I546229fe7ade95572e11bcda95a587228d84bc28
2015-12-25 10:27:54 -08:00
Jenkins
213176657d Merge "batch notification listener" 2015-12-11 04:16:57 +00:00
Mehdi Abaakouk
050024f798 Fix notifier options registration
Change-Id: I37082f6f349e89af6b74e6ec5e5c416902299263
2015-12-08 16:01:49 +01:00
Mehdi Abaakouk
4dd644ac20 batch notification listener
Gnocchi performs better if measurements are write in batch
When Ceilometer is used with Gnocchi, this is not possible.

This change introduce a new notification listener that allows that.

On the driver side, a default batch implementation is provided.
It's just call the legacy poll method many times.

Driver can override it to provide a better implementation.
For example, kafka handles batch natively and take benefit of this.

Change-Id: I16184da24b8661aff7f4fba6196ecf33165f1a77
2015-12-08 09:14:20 +01:00
Davanum Srinivas
33c1010c32 Option group for notifications
In change Ief6f95ea906bfd95b3218a930c9db5d8a764beb9, we 
decoupled RPC and Notifications a bit. We should take another
step and separate out the options for notifications into 
its own group.

Change-Id: Ib51e2839f9035d0cc0e3f459939d9f9003a8c810
2015-11-30 19:30:05 +00:00
Dina Belova
d05278f762 Modify simulator.py tool
Introduce mechanism of generating real life messages to the tool
using the information gathered during Rally testing. This change
allows to generate messages of the specfic length due to the
distribution observed on real environment.

messages_length.txt file contains lengths of string JSON objects
that were later sent through the MQ layer during deployment and
deletion of 50 VMs.

simulator.py was modified to use this data as a baseline to generate
random string messages of the required length with the needed
probability.

Change-Id: Iae21f90b5ca202bf0e83f1149baef8b42c64eb55
2015-10-22 17:34:17 +03:00
Dmitriy Ukhlov
f025639d8c Adapt functional tests to pika-driver
In this patch conf object passing through the fixtures to
objects is added

Also conf.prog and conf.project attributes are initialized
for tests

Change-Id: I4094043c3ea61cfd37cc998f140d506d4136e681
Partial-Implements: bp rabbit-pika
2015-10-07 19:06:07 +03:00
Davanum Srinivas
97892e656a Merge remote-tracking branch 'origin/feature/zmq' into merge-branch
Change-Id: If189d03131efc02045955508cef06fdd2ed590ee
2015-09-15 11:07:44 -04:00
Victor Sergeyev
28de384e9c Improve simulator.py
- added config options to set debug level
- added config options to show proceed messages per second on rpc-server
- added config options to select executor for rpc-server
- added config options to select call or cast mesages for rpc-client

Usage section updated

Change-Id: Ieadbc600f556ca5eb43b05abec69315b46023662
2015-08-20 11:56:42 +03:00
Oleksii Zamiatin
141f59bd9b Notifier implementation
Notifier implementation for zmq driver (ROUTER/DEALER variant).
Publishers/consumers refactoring in order to make them pluggable.

Change-Id: I2dd42cc805aa72b929a4dfa17498cd8b9c0ed7af
2015-08-05 13:35:24 +03:00
Doug Hellmann
857ccabc9c Drop use of 'oslo' namespace package
The Oslo libraries have moved all of their code out of the 'oslo'
namespace package into per-library packages. The namespace package was
retained during kilo for backwards compatibility, but will be removed by
the liberty-2 milestone. This change removes the use of the namespace
package, replacing it with the new package names. It also adds a local
hacking check to prevent regressions, while disabling style checks in
the "tests" directory, which will be deleted in a subsequent patch.

The patches in the libraries will be put on hold until application
patches have landed, or L2, whichever comes first. At that point, new
versions of the libraries without namespace packages will be released as
a major version update.

Please merge this patch, or an equivalent, before L2 to avoid problems
with those library releases.

Blueprint: remove-namespace-packages
https://blueprints.launchpad.net/oslo-incubator/+spec/remove-namespace-packages

Change-Id: Iad2ae13c771c99861ca9493c6ab10edcfbd8684a
2015-07-13 21:12:35 +00:00
Davanum Srinivas
3aa565b178 Tiny problem with notify-server in simulator
First argument has to be the integer id being passed in
from threads_spawner's spawn_n method

Change-Id: I32cbc231578c44b91c2218a62bb0e47c085a4397
2015-03-17 17:10:43 -04:00
Mehdi Abaakouk
513ce809fb tools: add simulator script
Add tools to play around oslo.messaging,
It allows to create rpc server and notification server
Or to spawn many client threads that send a defined number of messages.

Change-Id: I4d31f33ab4981309a67073e2a35cdef3b0ba7cb0
2015-03-11 17:36:32 +01:00