Skip to content

Collector refactoring, part 2 #1440

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

Merged
merged 15 commits into from
Aug 31, 2022
Merged

Collector refactoring, part 2 #1440

merged 15 commits into from
Aug 31, 2022

Conversation

Kobzol
Copy link
Contributor

@Kobzol Kobzol commented Aug 30, 2022

Now the collector crate has a reasonable module layout (at least to my taste), the largest files were split and all modules are under the library root, the collector binary only uses them. There is of course still a lot of legacy cruft in some of the interfaces, but I think that for now the refactoring effort is mostly completed from my side. I'll send more patches if needed for runtime benchmarks or benchmark error reporting.

Copy link
Member

@rylev rylev left a comment

Choose a reason for hiding this comment

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

This seems like a good refactoring. I tend to prefer medium size files (as opposed to the long files we had before or another approach where we have one file per type), and this seems to strike a good balance.

I'm interested what others have to say.

@nnethercote
Copy link
Contributor

I don't mind longer files, e.g. anything less than 2,000 lines and I don't bat an eyelid. So a lot of this doesn't feel that necessary to me. But I also won't stand in the way, particular given that Jakub (presumably) thinks this will help with the addition of runtime benchmarks.

@Kobzol
Copy link
Contributor Author

Kobzol commented Aug 31, 2022

It wasn't necessarily only the length that was annoying to me. The main issue for me was that some modules were included from the binary instead of the library root (this was annoying especially for the Profile and Scenario enums, which are used all over the place and prohibited using collector as a library properly).

Also, some files were a bit too overarching. A 2k line file is fine if it cares about a single area, but less so if it spans X (only semi-)related things that could be its own modules.

@Kobzol Kobzol force-pushed the collector-refactor-2 branch from 50bfec7 to 5a12bc5 Compare August 31, 2022 07:31
@rylev rylev merged commit e78840c into master Aug 31, 2022
@rylev rylev deleted the collector-refactor-2 branch August 31, 2022 10:04
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