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

update gopsutil #6483

Closed
preetapan opened this issue Oct 11, 2019 · 3 comments
Closed

update gopsutil #6483

preetapan opened this issue Oct 11, 2019 · 3 comments
Labels
theme/core theme/dependencies Pull requests that update a dependency file type/enhancement
Milestone

Comments

@preetapan
Copy link
Contributor

The library we used for stats collection has changed how windows stats collection works:
shirou/gopsutil#611

This will affect this code:
https://github.com/hashicorp/nomad/blob/master/client/stats/cpu_windows.go#L12

This issue captures updating gopsutil, as well as testing windows specific changes.

@preetapan preetapan added this to the near-term milestone Oct 11, 2019
@onlyjob
Copy link
Contributor

onlyjob commented Dec 30, 2019

Note that shirou/gopsutil 2.19.05 introduced breaking change shirou/gopsutil@cae8efc as per shirou/gopsutil#676 that causes the following FTBFS in Nomad:

src/github.com/hashicorp/nomad/client/structs/structs.go 
codecgen error: error running 'go run codecgen-main-102.generated.go': exit status 2, console: # github.com/hashicorp/nomad/client/stats 
../stats/host.go:278:70: times.Stolen undefined (type "github.com/shirou/gopsutil/cpu".TimesStat has no field or method Stolen) 

src/github.com/hashicorp/nomad/client/structs/structs.go:3: running "codecgen": exit status 1 

The patch for Nomad is trivial but please review it nevertheless:

--- a/client/stats/host.go
+++ b/client/stats/host.go
@@ -274,9 +274,9 @@
        currentUser := times.User
        currentSystem := times.System
        currentTotal := times.Total()
        currentBusy := times.User + times.System + times.Nice + times.Iowait + times.Irq +
-               times.Softirq + times.Steal + times.Guest + times.GuestNice + times.Stolen
+               times.Softirq + times.Steal + times.Guest + times.GuestNice

        deltaTotal := currentTotal - h.prevTotal
        idle = ((currentIdle - h.prevIdle) / deltaTotal) * 100
        user = ((currentUser - h.prevUser) / deltaTotal) * 100

@tgross tgross modified the milestones: near-term, unscheduled Jan 9, 2020
@tgross
Copy link
Member

tgross commented Mar 30, 2020

Closed by #7347

@tgross tgross closed this as completed Mar 30, 2020
@tgross tgross added the theme/dependencies Pull requests that update a dependency file label Mar 30, 2020
@tgross tgross modified the milestones: unscheduled , 0.11.0 Mar 30, 2020
@github-actions
Copy link

I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, 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 Nov 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
theme/core theme/dependencies Pull requests that update a dependency file type/enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants