Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow compare to continue for missing disk usage stats #1482

Merged
merged 2 commits into from
May 16, 2022

Conversation

inqueue
Copy link
Member

@inqueue inqueue commented May 6, 2022

This commit fixes an issue introduced by the one with the beaker when running esrally compare where disk usage stats are not present for prior benchmarks.

$ esrally compare --baseline=1ad6f592-14c7-4ffd-8c93-4eef6555eb9d --contender=bfdfe50a-d62f-45df-ac9a-6a1a5295d45f

    ____        ____
   / __ \____ _/ / /_  __
  / /_/ / __ `/ / / / / /
 / _, _/ /_/ / / / /_/ /
/_/ |_|\__,_/_/_/\__, /
                /____/


Comparing baseline
  Race ID: 1ad6f592-14c7-4ffd-8c93-4eef6555eb9d
-  Race timestamp: 2021-08-09 20:00:56
  Challenge: logging-querying
  Car: external
  User tags: env-id=4d577a92-4cf4-4da2-b1dd-948efb4a6d15

with contender
  Race ID: bfdfe50a-d62f-45df-ac9a-6a1a5295d45f
  Race timestamp: 2022-05-04 19:09:41
  Challenge: logging-querying
  Car: external
  User tags: env-id=18de9c61-7975-4aa9-800c-d2a984299268, setup=esbench

------------------------------------------------------
    _______             __   _____
   / ____(_)___  ____ _/ /  / ___/_________  ________
  / /_  / / __ \/ __ `/ /   \__ \/ ___/ __ \/ ___/ _ \
 / __/ / / / / / /_/ / /   ___/ / /__/ /_/ / /  /  __/
/_/   /_/_/ /_/\__,_/_/   /____/\___/\____/_/   \___/
------------------------------------------------------

[ERROR] Cannot compare. 'NoneType' object is not iterable.

rally.log

2022-05-06 21:26:32,719 -not-actor-/PID:70929 esrally.rally ERROR A fatal error occurred while running subcommand [compare].
Traceback (most recent call last):
  File "/Users/jbryan/dev/src/rally/esrally/rally.py", line 910, in dispatch_sub_command
    reporter.compare(cfg, args.baseline, args.contender)
  File "/Users/jbryan/dev/src/rally/esrally/reporter.py", line 49, in compare
    ComparisonReporter(cfg).report(race_store.find_by_race_id(baseline_id), race_store.find_by_race_id(contender_id))
  File "/Users/jbryan/dev/src/rally/esrally/reporter.py", line 397, in report
    metric_table_plain = self._metrics_table(baseline_stats, contender_stats, plain=True)
  File "/Users/jbryan/dev/src/rally/esrally/reporter.py", line 415, in _metrics_table
    metrics_table.extend(self._report_disk_usage_stats_per_field(baseline_stats, contender_stats))
  File "/Users/jbryan/dev/src/rally/esrally/reporter.py", line 652, in _report_disk_usage_stats_per_field
    for index, total, field in total_disk_usage_per_field(baseline_stats):
  File "/Users/jbryan/dev/src/rally/esrally/reporter.py", line 112, in total_disk_usage_per_field
    for field_stat in stats.disk_usage_total:
TypeError: 'NoneType' object is not iterable

@inqueue inqueue added the bug Something's wrong label May 6, 2022
@inqueue inqueue added this to the 2.5.0 milestone May 6, 2022
prev = for_idx.get(field, 0)
if prev < total:
for_idx[field] = total
if baseline_stats.disk_usage_total:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we only perform this work at all if both have disk_usage_total? so instead of these changes do (in line 415)

if baseline_stats.disk_usage_total and contender_stats.disk_usage_total:
    metrics_table.extend(self._report_disk_usage_stats_per_field(baseline_stats, contender_stats))

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense. Can we issue a warning about it? Something on the console?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we only perform this work at all if both have disk_usage_total? so instead of these changes do (in line 415)

I'm good with this since there can be no comparison if either element contains non-existent objects. I'll give it a try to ensure it does what we want.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense. Can we issue a warning about it? Something on the console?

I was ready to add a warning until I thought it would add noise when running comparisons against metrics generated with older Rally versions and disk_usage_total=[] for later versions. I'm interested in your thoughts.

What do you think instead about setting <x>.disk_usage_total=[] when <x>.disk_usage_total=None? This way we'll show disk usage metrics if they exist for one of the subjects, and not leave anything out.

@nik9000
Copy link
Member

nik9000 commented May 11, 2022 via email

@DJRickyB
Copy link
Contributor

I don't think a warning is appropriate. currently when we run compare on two un-alike (for whatever reason) races, it just quietly filters out rows that are not shared between the two races. This issue is just a bugfix for a missing field from older indices, I think the overall behavior of compare could be discussed in a different issue

Copy link
Contributor

@DJRickyB DJRickyB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something's wrong
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants