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

Remove dependencies from procfs and sysfs onto xfs, nfs, bcache, and iostats #136

Merged
merged 5 commits into from
Mar 28, 2019

Conversation

pgier
Copy link
Collaborator

@pgier pgier commented Feb 20, 2019

Make the xfs and nfs packages dependent on procfs
instead of the procfs package dependent on xfs and nfs.
This allows clients to depend on procfs without bringing
in xfs and nfs.

This is a possibility for option 1 of issue #135

@pgier pgier changed the title WIP reverse procfs to xfs and nfs dependencies WIP remove dependencies from procfs and sysfs onto xfs, nfs, bcache, and iostats Feb 23, 2019
@simonpasquier simonpasquier self-requested a review February 28, 2019 15:36
@simonpasquier
Copy link
Member

From a quick look, it looks ok to me.

@SuperQ SuperQ requested review from juliusv and beorn7 March 5, 2019 19:38
@SuperQ
Copy link
Member

SuperQ commented Mar 5, 2019

@juliusv @beorn7 Would you please review this refactoring?

@beorn7 beorn7 requested a review from grobie March 7, 2019 14:46
@beorn7
Copy link
Member

beorn7 commented Mar 7, 2019

I'm not familiar with this code. Wouldn't @grobie be the most natural reviewer?

@SuperQ
Copy link
Member

SuperQ commented Mar 7, 2019

@grobie isn't maintaining this much anymore. We're currently working on finding a new owner.

@beorn7
Copy link
Member

beorn7 commented Mar 7, 2019

Understood. Currently, I cannot volunteer as a new maintainer for lack of time.

For the time being, I would still prefer if @grobie could have a look here. I guess his lack of time is as bad as mine, but he would need less time to review this as he already knows the code.

@pgier pgier force-pushed the xfs-nfs-refactor branch from f54deb2 to 6fe83b2 Compare March 8, 2019 15:49
@pgier pgier changed the title WIP remove dependencies from procfs and sysfs onto xfs, nfs, bcache, and iostats Remove dependencies from procfs and sysfs onto xfs, nfs, bcache, and iostats Mar 8, 2019
@discordianfish
Copy link
Member

@grobie Can you just let us know if you will be reviewing this? I know you wanted to propose doing exactly this IIRC, so naturally you'd be the best person to review this.
If you don't have time, no worries. I'll just do my best to review :)

@grobie
Copy link
Member

grobie commented Mar 17, 2019 via email

Copy link
Member

@grobie grobie left a comment

Choose a reason for hiding this comment

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

Great seeing the coupling between the procfs package and other packages being broken up! Changing the interface to require the procfs mountpoint as first argument appears to be a reasonable tradeoff between package isolation and simplicity vs. code repetition. The idea of having a filesystem structure didn't scale well with the introduction of additional packages.

I left a few minor comments, but don't have bigger concerns. Do you plan to adjust the functions in procfs accordingly so that all functions have a similar signature?

blockdevice/stats.go Outdated Show resolved Hide resolved
blockdevice/stats.go Outdated Show resolved Hide resolved
blockdevice/stats.go Outdated Show resolved Hide resolved
xfs/xfs_test.go Show resolved Hide resolved
pgier added 4 commits March 26, 2019 14:15
Remove the dependencies from procfs and sysfs on xfs, nfs, bcache, and
disk iostats.  And make these package self contained so they
do not bring in any additional dependencies.

Also refactor the iostats package into a blockdevice package, and
improve naming and organization of this package.

Signed-off-by: Paul Gier <pgier@redhat.com>
This allows the client to determine whether the discard fields are
valid.

Signed-off-by: Paul Gier <pgier@redhat.com>
Signed-off-by: Paul Gier <pgier@redhat.com>
Signed-off-by: Paul Gier <pgier@redhat.com>
@pgier pgier force-pushed the xfs-nfs-refactor branch from 5a586b3 to 5d3eddf Compare March 26, 2019 19:16
@pgier
Copy link
Collaborator Author

pgier commented Mar 26, 2019

Rebased to get circleci build config changes.

@pgier
Copy link
Collaborator Author

pgier commented Mar 26, 2019

I left a few minor comments, but don't have bigger concerns. Do you plan to adjust the functions in procfs accordingly so that all functions have a similar signature?

@grobie Yes, I think it would be good to completely remove the FS type and associated functions and adjust the remaining functions in procfs and sysfs. I think this would work well in the typical usage in node_exporter since each collector creates its own FS and does it's own file system checks, etc.

@@ -11,23 +11,20 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package xfs_test
Copy link
Contributor

Choose a reason for hiding this comment

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

A nit as the author of this package: I would prefer this to remain xfs_test so we are forced to exercise the exported API. It doesn't appear any unexported calls are used anyway.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I agree this makes sense since we're trying to validate API usage. I have changed parse_test and xfs_test back to using the xfs_test package. I'll review some of the other packages to see where it makes sense to follow the same pattern.

Signed-off-by: Paul Gier <pgier@redhat.com>
@grobie grobie merged commit af7bedc into prometheus:master Mar 28, 2019
remijouannet pushed a commit to remijouannet/procfs that referenced this pull request Oct 20, 2022
Remove dependencies from procfs and sysfs onto xfs, nfs, bcache, and iostats
bobrik pushed a commit to bobrik/procfs that referenced this pull request Jan 14, 2023
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.

7 participants