Skip to content

Please consider this patch to update processor count and create a couple new facts.#437

Closed
riffraff169 wants to merge 4 commits intopuppetlabs:masterfrom
riffraff169:master
Closed

Please consider this patch to update processor count and create a couple new facts.#437
riffraff169 wants to merge 4 commits intopuppetlabs:masterfrom
riffraff169:master

Conversation

@riffraff169
Copy link

(#19249) Split ProcessorCount to separate TotalProcessorCount and ActiveProcessorCount facts

(#19249) Split ProcessorCount to separate TotalProcessorCount and ActiveProcessorCount facts
@adrienthebo
Copy link

Thank you for this pull request!

This is a really unusual pull request, because it brings up some concerns that I haven't really seen before. Do you foresee any cases where both of these facts would need to be used? Can we just treat active CPUs as the meaningful value and ignore the total count?

@riffraff169
Copy link
Author

The only time I would see would be for reporting, if you want a report of all systems with lest active processors than present.  I know the foreman statistics page shows inaccurate cpu counts because of the incorrect cpu determination, so I'm hoping to get a patch to foreman after this to get the correct number, but I don't know of anything else.

I would only say that since the code is so easy, we may as well add it rather than not and find it is useful later on.  If it was really long and complex for little return, then I would say ignore it.

Thanks


From: Adrien Thebo notifications@github.com
To: puppetlabs/facter facter@noreply.github.com
Cc: riffraff169 riffraff169@yahoo.com
Sent: Wednesday, May 1, 2013 6:42 PM
Subject: Re: [facter] Please consider this patch to update processor count and create a couple new facts. (#437)

Thank you for this pull request!
This is a really unusual pull request, because it brings up some concerns that I haven't really seen before. Do you foresee any cases where both of these facts would need to be used? Can we just treat active CPUs as the meaningful value and ignore the total count?

Reply to this email directly or view it on GitHub.

Choose a reason for hiding this comment

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

All facts are downcased for later use, so using uppercase when declaring the fact itself is a little obfuscated.

Copy link
Author

Choose a reason for hiding this comment

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

Ok, no problem, I was just using the same format as other facts.

@adrienthebo
Copy link

I've gone through and added a bunch of inline comments about this implementation. In addition this should have unit tests to help prevent regressions; would you be willing/comfortable to do that?

@riffraff169
Copy link
Author

I will re-pull the repo and work on this stuff.  I'll look at unit tests, although I will admit I've never done ruby/facter/puppet unit tests before, so it will take me a little bit to get up to speed.


From: Adrien Thebo notifications@github.com
To: puppetlabs/facter facter@noreply.github.com
Cc: riffraff169 riffraff169@yahoo.com
Sent: Friday, May 3, 2013 2:27 PM
Subject: Re: [facter] Please consider this patch to update processor count and create a couple new facts. (#437)

I've gone through and added a bunch of inline comments about this implementation. In addition this should have unit tests to help prevent regressions; would you be willing/comfortable to do that?

Reply to this email directly or view it on GitHub.

@adrienthebo
Copy link

@riffraff169 If you would like help with rspec tests, IRC would be one of the best ways to get ahold of me. I'm generally available on irc.freenode.net from 9:00 AM - 5:00 PM in #puppet and #puppet-dev, and my nickname is finch.

@HAIL9000
Copy link

I noticed this hasn't seen any activity in about a week, do you think you'll be able to work on it in the near future?

No pressure, just checking in.

@riffraff169
Copy link
Author

Yes, I'm going to try to work on it with Adrien this coming week; work and family stuff was taking my time away.


From: Hailee Kenney notifications@github.com
To: puppetlabs/facter facter@noreply.github.com
Cc: riffraff169 riffraff169@yahoo.com
Sent: Friday, May 10, 2013 7:22 PM
Subject: Re: [facter] Please consider this patch to update processor count and create a couple new facts. (#437)

I noticed this hasn't seen any activity in about a week, do you think you'll be able to work on it in the near future?
No pressure, just checking in.

Reply to this email directly or view it on GitHub.

@riffraff169
Copy link
Author

The other related ticket is kind of interesting, I might check on that too, although in our case every socket is populated (as far as I know, I will have to double-check that).  We are spanning activated cpus across sockets so we can access all physical memory.


From: Hailee Kenney notifications@github.com
To: puppetlabs/facter facter@noreply.github.com
Cc: riffraff169 riffraff169@yahoo.com
Sent: Friday, May 10, 2013 7:22 PM
Subject: Re: [facter] Please consider this patch to update processor count and create a couple new facts. (#437)

I noticed this hasn't seen any activity in about a week, do you think you'll be able to work on it in the near future?
No pressure, just checking in.

Reply to this email directly or view it on GitHub.

@HAIL9000
Copy link

No rush on adding those tests, just wanted to check in and make sure this pull request was still active.

And you definitely don't need to worry about the other ticket if it's not directly related to your issue, I just wanted to associate those two tickets in case they were stemming from the same problem.

change processorcount to be same as totalprocessorcount, probably will remove totalprocessorcount

Choose a reason for hiding this comment

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

We can delete this copy of :processorcount, since this is more or less defined twice.

@adrienthebo
Copy link

For my own sake, I'm noting that we have to check sysfs for :processorcount of /proc/cpuinfo indicates we have 0 CPUs because of https://projects.puppetlabs.com/issues/2945.

@adrienthebo
Copy link

summary: merged into master in ecc5f90. Since the existing processor specs were pretty messy I reworked them to make things a bit clearer. Thanks again for this contribution!

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