ci: elasticsearch: Upload script improvements #76889
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Multiple improvements of the
upload_test_results_es.py
script:JSON objects flattening.
This feature allows
twister.json
file preprocessing to simplify its Elasticsearch index structure for complex hierarhical objects, for example with memory footprint, or code coverage data.A new command line option
--flatten
is added to change testsuite data structure in regard of one of its list objects: eithertestcases
orrecording
, so each item there becomes an independent data record inheriting all other testsuite properties, whereas the children object's properties are renamed with the parent object's name as a prefix: 'testcases_' or 'recording_' respectively. Only one testsuite property can be flattened this way per index upload. Other children objects will be treated accorging to the index structure.Related new command line options (with help text explanations):
--flatten-dict-name
,--flatten-list-names
,--flatten-separator
,--transpose-separator
,--escape-separator
A new command line option
--transform
is added to allow regexp group parsing in string propertites extracting additional derived properties.A new command line option
--exclude
is added to exclude testsuite properties not needed to store at Elasticsearch index.Branch name
--run-branch
and Workflow ID--run-workflow
command line options as additional key fields to allow data from different branches, workflows and triggering events in the same index.A new command line option
--map-file
is added to apply an explicit index structure to thetwister.json
input data.Add bulk operation timeout parameter for heavy/long uploads.
Other changes:
Previously mentioned in relation to memory footprint data collection.
Examples of use:
Collect data from tests with recording:
kernel.timer.timer
,kernel.timer.timer_behavior_external
)benchmark.kernel.latency.*
,benchmark.user.latency.*
)Collect footprint data (Twister with
--footprint-report
and--enable-size-report
)Other possible use - keep code coverage data with #66345