Skip to content

Commit

Permalink
Minor UI improvements + New demo
Browse files Browse the repository at this point in the history
  • Loading branch information
andyone committed May 29, 2020
1 parent b52aeee commit 5e34c87
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 18 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

### Usage demo

[![demo](https://gh.kaos.st/fz-001.gif)](#usage-demo)
[![demo](https://gh.kaos.st/fz-003.gif)](#usage-demo)

### Installation

Expand Down
19 changes: 2 additions & 17 deletions fz.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,11 @@ func renderInfo(cur Info) {
crashersTag = "{r}"
}

execsArrow := getDynamicsArrow(cur.ExecsPerSec, prevInfo.ExecsPerSec)

fmtc.TPrintf(
"{s}%s{!} {s-}[%s]{!} {*}Workers:{!} "+workersTag+"%d{!} {s-}•{!} {*}Corpus:{!} "+corpusTag+"%s{!} {s-}(%s){!} {s-}•{!} {*}Crashers:{!} "+crashersTag+"%d {s-}•{!} {*}Restarts:{!} %s {s-}•{!} {*}Cover:{!} "+coverTag+"%s{!} {s-}•{!} {*}Execs:{!} {s}%s{!}%s{s}/s{!} {s-}(%s){!}",
"{s}%s{!} {s-}[%s]{!} {*}Workers:{!} "+workersTag+"%d{!} {s-}•{!} {*}Corpus:{!} "+corpusTag+"%s{!} {s-}(%s){!} {s-}•{!} {*}Crashers:{!} "+crashersTag+"%d {s-}•{!} {*}Restarts:{!} %s {s-}•{!} {*}Cover:{!} "+coverTag+"%s{!} {s-}•{!} {*}Execs:{!} %s{s}/s{!} {s-}(%s){!}",
cur.DateTime, formatDuration(cur.Uptime), cur.Workers, fmtutil.PrettyNum(cur.Corpus),
formatDuration(cur.CorpusDur), cur.Crashers, cur.Restarts, fmtutil.PrettyNum(cur.Cover),
execsArrow, fmtutil.PrettyNum(cur.ExecsPerSec), fmtutil.PrettyNum(cur.Execs),
fmtutil.PrettyNum(cur.ExecsPerSec), fmtutil.PrettyNum(cur.Execs),
)
}

Expand Down Expand Up @@ -241,19 +239,6 @@ func getIndicatorTag(v1, v2 int) string {
}
}

// getIndicatorTag returns arrow symbol based on difference between
// current and previous values
func getDynamicsArrow(v1, v2 int) string {
switch {
case v1 > v2:
return "↑"
case v1 < v2:
return "↓"
default:
return ""
}
}

// formatDuration formats duration
func formatDuration(d int64) string {
var min, sec int64
Expand Down

0 comments on commit 5e34c87

Please sign in to comment.