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

fix(MobilityDataValidation): slow on large gtfs files #525

Closed
wants to merge 4 commits into from

Conversation

miles-grant-ibigroup
Copy link
Contributor

Checklist

  • Appropriate branch selected (all PRs must first be merged to dev before they can be merged to master)
  • Any modified or new methods or classes have helpful JavaDoc and code is thoroughly commented
  • The description lists all applicable issues this PR seeks to resolve
  • The description lists any configuration setting(s) that differ from the default settings
  • All tests and CI builds passing

Description

The MobilityData validator takes a while between finishing and saving results. There is no way to check when this process completes using their api. The solution is to do a wait, currently 5 seconds. However, on large feeds this is not enough. The solution is to adjust the wait depending on file size.

Closes #524

Looking to try this fix on as wide a variety of systems as possible to make sure the values are correct

// TODO: base this on the file being completely saved rather than a fixed amount of time.
Thread.sleep(5000);
// 5 seconds + ~1 second per 10mb
Thread.sleep(5000 + (this.fileSize / 10000));
Copy link
Contributor

Choose a reason for hiding this comment

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

What unit is this.fileSize? According to the code, it is set with [newGtfs]File.length() which is in bytes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure, but this does fix things

Copy link
Contributor

Choose a reason for hiding this comment

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

@miles-grant-ibigroup Can you fix the comment so it corresponds to the code?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Did I get the decimal math right in 0ebf222?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm sorry, the initial comment was correct, juggling with the units was confusing (10,000,000 / 10,000 = 1000).

Copy link
Contributor

@binh-dam-ibigroup binh-dam-ibigroup left a comment

Choose a reason for hiding this comment

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

It was indeed 1 sec / 10 MB...

@miles-grant-ibigroup miles-grant-ibigroup deleted the mb-validator-slow-on-large-gtfs branch May 24, 2023 14:24
@miles-grant-ibigroup
Copy link
Contributor Author

Not sure why it says closed instead of merged...

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

Successfully merging this pull request may close these issues.

MobilityData Validator CSV Parsing Issue with large GTFS files
3 participants