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(blockdevice): added sysblockdevicesize method and test #650

Closed
wants to merge 6 commits into from

Conversation

fs185143
Copy link

@fs185143 fs185143 commented Jul 3, 2024

In part to support prometheus/node_exporter#3068, I have added a new method that retrieves the value of /sys/block/<device>/size

@fs185143
Copy link
Author

fs185143 commented Jul 3, 2024

need to add blockdevice/testdata/fixtures/sys/block/sda/size as 3750748848

edit: i believe i did this in 8dc60f1

blockdevice/stats.go Outdated Show resolved Hide resolved
if err != nil {
return 0, err
}
return 512 * size, nil
Copy link
Member

Choose a reason for hiding this comment

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

Let's make this a const SectorSize

Copy link
Author

Choose a reason for hiding this comment

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

@fs185143
Copy link
Author

just following up on this cc @discordianfish

@fs185143
Copy link
Author

just following up on this cc @discordianfish

or cc @SuperQ

@fs185143
Copy link
Author

hey could I get a review on this please? any idea who might be best to take a look @dswarbrick

@dswarbrick
Copy link
Contributor

@fs185143 You'll have better luck attracting the attention of maintainers if all CI tests are green, plus all commits need to be signed off to comply with the DCO.

@fs185143
Copy link
Author

closing in favour of #658 (fixed issues like DCO)

@fs185143 fs185143 closed this Aug 14, 2024
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