This spec proposes improvements related to atomic actions: * rename term "atomic actions" into "actions" * store actions as list of dicts instead of OrderedDict * introduce nested actions saved in "children" container * start and end timestamps * get rid of duration time (since we have timestamps) Blueprint: improve-atomic-actions Change-Id: Ic22c00cf40c36205628dd3bf18b0f09f92fad8c0
4.9 KiB
New Atomic actions format in workload results
Currently atomic actions data in workload results is insufficient, therefore some new features can not be implemented.
Problem description
The main problem is that current format does not support nested atomic actions.
Also, atomic actions data does not include timestamps for each action start and end time. Having this data will allow us to inspect atomic actions runtime better and generate detailed reports.
Since word "atomic" means something that can not be splitted into parts and we introduce nested atomic actions, we should use different term instead of "atomic actions".
Proposed change
Term "atomic actions" should be renamed to just "actions".
Change actions results schema from type "object" to "array" and extend it with timestamps and nested actions.
Nested actions will be represented by "children" key and have single level of nesting, since there is no need of more nested levels. We could implement deeper nesting at any time later, if required.
With timestamps, there is no need to save durations anymore, so get rid of this value.
Since this change is not backward compatible, we need to create a database migration script. The migration will use iteration start timestamp as start timestamp for first action and then calculate further timestamps based on actions order and their durations.
Benefits of new format
Nested actions will make actions measurement more detailed and flexible since we could have data what sub-actions were run during specific action runtime, without complicated changes at code.
Start and end timestamps will provide us with accurate information about action runtime within the whole iteration and ability to create Gantt charts.
Schema modification
Schema location is rally.common.objects.task.TASK_RESULT_SCHEMA ["properties"]["result"]["properties"]["atomic_actions"]
should be moved to rally.common.objects.task.TASK_RESULT_SCHEMA ["properties"]["result"]["properties"]["actions"]
and changed:
AS IS:
{"type": "object"
}
Here keys are actions names, and values are their durations. Actions data is actually represented by collections.OrderedDict, so we have real order saved.
Example:
"keystone.create_tenant", 0.1234),
OrderedDict([("keystone.create_users", 1.234)]) (
TO BE:
{"type": "array",
"items": {
"type": "object",
"properties": {
"name": {"type": "string"}, # name of action
"started_at": {"type": "number"}, # float UNIX timestamp
"finished_at": {"type": "number"}, # float UNIX timestamp
"children": { # nested actions, single level
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {"type": "string"},
"started_at": {"type": "number"},
"finished_at": {"type": "number"}
},"required": ["name", "started_at", "finished_at"],
"additionalProperties": False
},"minItems": 0
}
},"required": ["name", "started_at", "finished_at", "children"],
"additionalProperties": False
},"minItems": 0
}
Example how this data can be represented:
"name": "keystone.create_tenant",
[{"started_at": 1455281370.288397,
"finished_at": 1455281372.672342,
"children": []},
"name": "keystone.create_users",
{"started_at": 1455281372.931324,
"finished_at": 1455281373.375184,
"children": []}]
Alternatives
None
Implementation
Assignee(s)
- Primary assignee:
-
Alexander Maretskiy <amaretskiy@mirantis.com>
Work Items
- Rename atomic actions into actions
- Improve actions results format
- Create a DB migartion that transforms results to new format
Dependencies
None