Skip to content
This repository has been archived by the owner on Aug 29, 2020. It is now read-only.

OpenBSD support #112

Merged
merged 4 commits into from
Feb 23, 2019
Merged

OpenBSD support #112

merged 4 commits into from
Feb 23, 2019

Conversation

omar-polo
Copy link
Contributor

@omar-polo omar-polo commented Feb 18, 2019

Hi!

This adds openbsd to proc_other build tags (needed to build gotop and to get the list of processes) and implements update for Temp (loosely based on sysctl(8) code). With these changes gotop builds and runs on OpenBSD-CURRENT on amd64.

The disk, memory and network usage widgets worked OOTB, while the cpu usage displays wrong percentages (almost always 100% on all CPUs). Battery also doesn't seem to work, but I'll look into that.

It's the first time I write go code, I hope it doesn't suck too much.

Demonstrative screenshot:
2019-02-18-113045_1105x667_scrot

@omar-polo
Copy link
Contributor Author

just checked: the problem I have with the battery is distatus/battery fault. It doesn't recognize the battery on my system for some reason. I'm trying to understand why that code fails, but that it's outside the scope of this pull request.

The CPU problem is similar but weirder: gotop displays all CPUs at 100% while shirou/gopsutil/cpu report every CPU at 0%. I still have to figure it out why.

@pikadirr
Copy link

Hi Omar, I don't get why you are asking me because I know nothing about cars.. :/

@cjbassi
Copy link
Owner

cjbassi commented Feb 22, 2019

Thanks for working on this and glad you were able to mostly get it working so far. The code looks good, I pushed one commit to your fork to fix a couple minor things. The CPU issue seems strange since we're pretty much just appending the results from gopsutil to an array and drawing those. As far as the battery goes, some other people were having issues too, maybe these might help: #100, distatus/battery#8 But the battery is less of a priority like you said.

@cjbassi
Copy link
Owner

cjbassi commented Feb 22, 2019

If we can get the CPUs working, then we can merge this and open an issue for the batteries. It would also be good to determine if the battery issue you're getting is the same as the issue described in those 2 links.

@omar-polo
Copy link
Contributor Author

Hi,
thanks for the fix, the code looks better now.

Forget what I said about the 0% on all CPUs, I made an error in a script to test shirou/gopsutil/cpu. But the fact that the percentage reported aren't right still remains. I'm gonna test it a couple of days on a machine with OpenBSD 6.4-STABLE to check if it's a recent change in the OS that breaks gopsutil, and then report to shirou.

For the battery: at first sight it doesn't seem the same issue: the battery scripts from distatus/battery outputs "No batteries" on my system. I'll look into it during the next week.

@cjbassi
Copy link
Owner

cjbassi commented Feb 23, 2019

Sounds good. I guess we can merge this then since the rest of the issues are external. I created #117 and #118 to track the 2 issues, so feel free to report on any findings there.

This pull request was closed.
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