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

feat: more validation during preprocessing #90

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

bajtos
Copy link
Member

@bajtos bajtos commented Dec 7, 2023

  • refactor: types for raw and parsed measurements
  • feat: more validation in pre-process step

Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
@bajtos
Copy link
Member Author

bajtos commented Dec 7, 2023

@juliangruber I would like to push validations from 'retrieval-stats.js' to 'preprocess.js'.

I am seeking early feedback:

  • What do you think about the proposed approach?
  • Are there any particular new tests I should write?

(Some of the existing tests are failing now; I am aware of that.)

this.duration = endAt - startAt
if (this.duration < 0) {
throw new Error('Invalid measurement: end_at is before start_at.')
}
}
Copy link
Member Author

Choose a reason for hiding this comment

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

TODO: check that endAt > firstByteAt

Copy link
Member

@juliangruber juliangruber left a comment

Choose a reason for hiding this comment

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

I'm all for validation as soon as possible, so that we get an early abort and clean data afterwards

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

Successfully merging this pull request may close these issues.

None yet

2 participants