Merge branch 'master' into patch-1

This commit is contained in:
xxxserxxx 2020-03-03 22:43:28 -06:00 committed by GitHub
commit 164e2b6167
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 39 additions and 12 deletions

View File

@ -6,12 +6,15 @@ about: Template to report bugs.
<!-- Please search existing issues to avoid creating duplicates. --> <!-- Please search existing issues to avoid creating duplicates. -->
<!-- Also please test using the latest build to make sure your issue has not already been fixed. --> <!-- Also please test using the latest build to make sure your issue has not already been fixed. -->
Required information: ##### gotop version:
`gotop -V`, or if built from source, `git rev-parse HEAD`
- gotop version (`gotop -V`): ##### OS/Arch:
- The output of `uname -a`: Linux: `uname -or`, OSX: `sw_vers`; Windows: `systeminfo | findstr /B /C:"OS Name" /C:"OS Version"`
- Terminal emulator (e.g. iTerm or gnome terminal): ##### Terminal emulator:
- Any relevant hardware info: e.g. iTerm, kitty, xterm, PowerShell
- tmux version if using tmux: ##### Any relevant hardware info:
If the issue is clearly related to a specific piece of hardware, e.g., the network
##### tmux version:
`tmux -V`, if using tmux
Also please copy or attach `~/.local/state/gotop/errors.log` if it exists and contains logs: Also please copy or attach `~/.local/state/gotop/errors.log` if it exists and contains logs:

View File

@ -28,8 +28,6 @@ import (
const ( const (
appName = "gotop" appName = "gotop"
// TODO: Set this at compile time; having to check this in sucks.
version = "3.4.5"
graphHorizontalScaleDelta = 3 graphHorizontalScaleDelta = 3
defaultUI = "cpu\ndisk/1 2:mem/2\ntemp\nnet procs" defaultUI = "cpu\ndisk/1 2:mem/2\ntemp\nnet procs"
@ -39,6 +37,8 @@ const (
) )
var ( var (
// TODO: Set this at compile time; having to check this in sucks.
Version = "3.4.5"
conf gotop.Config conf gotop.Config
help *w.HelpMenu help *w.HelpMenu
bar *w.StatusBar bar *w.StatusBar
@ -50,7 +50,6 @@ var (
// TODO: state:merge #135 linux console font (cmatsuoka/console-font) // TODO: state:merge #135 linux console font (cmatsuoka/console-font)
// TODO: state:deferred 157 FreeBSD fixes & Nvidia GPU support (kraust/master). Significant CPU use impact for NVidia changes. // TODO: state:deferred 157 FreeBSD fixes & Nvidia GPU support (kraust/master). Significant CPU use impact for NVidia changes.
// TODO: Virtual devices from Prometeus metrics @feature // TODO: Virtual devices from Prometeus metrics @feature
// TODO: state:merge #167 configuration file (jrswab/configFile111)
// TODO: Abstract out the UI toolkit. mum4k/termdash, VladimirMarkelov/clui, gcla/gowid, rivo/tview, marcusolsson/tui-go might work better for some OS/Archs. Performance/memory use comparison would be interesting. // TODO: Abstract out the UI toolkit. mum4k/termdash, VladimirMarkelov/clui, gcla/gowid, rivo/tview, marcusolsson/tui-go might work better for some OS/Archs. Performance/memory use comparison would be interesting.
func parseArgs(conf *gotop.Config) error { func parseArgs(conf *gotop.Config) error {
usage := ` usage := `
@ -97,7 +96,7 @@ Colorschemes:
return err return err
} }
args, err := docopt.ParseArgs(usage, os.Args[1:], version) args, err := docopt.ParseArgs(usage, os.Args[1:], Version)
if err != nil { if err != nil {
return err return err
} }

View File

@ -1,5 +1,7 @@
package devices package devices
// TODO: https://github.com/elastic/go-sysinfo
import ( import (
"log" "log"
"time" "time"

View File

@ -23,7 +23,11 @@ func init() {
} }
for i := 0; i < len(vals); i++ { for i := 0; i < len(vals); i++ {
key := fmt.Sprintf(formatString, i) key := fmt.Sprintf(formatString, i)
cpus[key] = int(vals[i]) v := vals[i]
if v > 100 {
v = 100
}
cpus[key] = int(v)
} }
return nil return nil
} }

View File

@ -14,3 +14,22 @@ credentials to aurpublish to the AUR repository, so the final publish step is
still currently manual. still currently manual.
Oh, what a tangled web. Oh, what a tangled web.
Nix adds new and interesting complexities to the release.
1. cd to the nixpkgs directory
2. docker run -it --rm --mount type=bind,source="\$(pwd)",target=/mnt nixos/nix sh
3. cd /mnt
4. nix-prefetch-url --unpack https://github.com/xxxserxxx/gotop/archive/v3.3.2.tar.gz
5. Copy the sha256
6. Update the version and hash in nixpkgs/pkgs/tools/system/gotop/default.nix
8. In docker, install & run vgo2nix to update deps.nix
7. nix-build -A gotop
For plugin development:
```
V=$(git show -s --format=%cI HEAD | cut -b -19 | tr -cd '[:digit:]')-$(git rev-parse HEAD | cut -b -12)
go build -ldflags "-X main.Version=$V" -o gotop ./cmd/gotop
```