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

Fingerprint CPU model name, count of cores #3

Merged
merged 3 commits into from
Aug 26, 2015
Merged

Conversation

catsby
Copy link
Contributor

@catsby catsby commented Aug 26, 2015

Baby steps to fingerprint CPU information. Sanity check on progress to make sure I'm not doing something dumb...


cpuInfo, err := cpu.CPUInfo()
if err != nil {
f.logger.Println("[WARN] Error reading CPU information:", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel like we should return the error here, but based on the way Fingerprint is called I think logging and continuing is a good call for now.

Maybe we should look into letting these bubble up to the Client.fingerprint call. Thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I meant to ask about this; I think returning an error is ideal, but I wasn't really sure for now so I just logged.

Re: bubbling, maybe change the error to a go-multierror and doing something with them in Client? Seems like a decent idea

Copy link
Member

Choose a reason for hiding this comment

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

I've been prefixing the messages with something like "fingerprint.os: Error ..." so when users report things it helps us narrow the log site.

@cbednarski
Copy link
Contributor

Looks good! I think we can address my question in another PR.

modelName = c.ModelName
}
if numCores > 0 {
node.Attributes["cpu.numcores"] = strconv.FormatInt(int64(numCores), 10)
Copy link
Member

Choose a reason for hiding this comment

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

We also need to set the node.Resources.CPU to numCores * cpuFreq

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't reliably have cpu frequency yet 😦

@armon
Copy link
Member

armon commented Aug 26, 2015

Looking good, I'd move to cpu.go and prefix log messages with fingerprint.cpu. We also need to populate the Resources in addition to Attributes but its the same data.

catsby added a commit that referenced this pull request Aug 26, 2015
Fingerprint CPU model name, count of cores
@catsby catsby merged commit a0acbb4 into master Aug 26, 2015
@cbednarski cbednarski deleted the cpu-fingerprinting branch August 27, 2015 00:22
schmichael pushed a commit that referenced this pull request Oct 12, 2017
mikemccracken added a commit to mikemccracken/nomad that referenced this pull request Mar 2, 2018
…me-validation

do not attempt to validate volumes config if it is not found
claire-labry added a commit that referenced this pull request Mar 24, 2022
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants