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

Add Gardener v2 parser for switch datatype #1059

Merged
merged 3 commits into from
Mar 2, 2022

Conversation

robertodauria
Copy link
Contributor

@robertodauria robertodauria commented Mar 1, 2022

This PR is a duplicate of #1044, which was reverted in #1049. The v1 parser has been frozen (#1051) so that we should now be able to merge this new v2 parser without disrupting v1 parsers.

The only change, other than updating the branch from master, was renaming TestCount -> TestTotal in switch.go since the metric's name has been recently changed.


This change is Reviewable

* Initial implementation of the new switch datatype parser.

* Fix error handling in parser/switch.go

* Fix error handling.

* Fill in summary field from samples

* Use reflection and add unit tests.

* Do not return an error on unknown metrics.

This means we just fill the fields we want in the summary, and ignore
any extra data.

* Update update-schema/update.go to refer to the new SwitchRow struct.

* Update switch datatype parser and schema to use int64

* Update dataset/table names in update.go

* Add ID to SwitchRow and Broadcast-related fields to the summary.

* The "a" field should be lowercase.

* Update partition field for the switch table.

* Use DATE instead of TIMESTAMP and add CollectionTime to the summary.

Also, it's easier to use machine and site if they are not hostnames.

* Update comments.

* Update regex to account for v1 M-Lab hostnames.

* Add accurate estimation of SwitchRow's size.

* Update go.mod/go.sum after running go mod tidy.

* Remove commented line

* Update comment.

* Update ID format and variable name.

* Update comments.

* Add condition to only remove octets.local.tx/rx when needed.

* Update switch parser tests.

* s/valField/deltaField/

* Update tests.

* Updated tests to verify switch discards.

* Update tests.

* Update comment.

* Sort output by timestamp in the switch parser
@coveralls
Copy link
Collaborator

coveralls commented Mar 1, 2022

Pull Request Test Coverage Report for Build 7212

  • 145 of 223 (65.02%) changed or added relevant lines in 3 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.1%) to 64.601%

Changes Missing Coverage Covered Lines Changed/Added Lines %
parser/parser.go 0 2 0.0%
parser/switch.go 145 178 81.46%
schema/switch_schema.go 0 43 0.0%
Files with Coverage Reduction New Missed Lines %
schema/switch_schema.go 2 0%
Totals Coverage Status
Change from base Build 7210: 0.1%
Covered Lines: 3982
Relevant Lines: 6164

💛 - Coveralls

Copy link
Contributor

@stephen-soltesz stephen-soltesz left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: :shipit: complete! 1 of 1 approvals obtained

@robertodauria robertodauria merged commit 3587755 into master Mar 2, 2022
@robertodauria robertodauria deleted the sandbox-roberto-switch-parser branch March 2, 2022 08:35
@stephen-soltesz
Copy link
Contributor

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.

3 participants