Skip to content

Commit

Permalink
adjust header's styles of iostat/nicstat tabs in top utility
Browse files Browse the repository at this point in the history
  • Loading branch information
lesovsky committed Oct 2, 2019
1 parent ea40b86 commit d170322
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions doc/Changelog
@@ -1,4 +1,5 @@
pgcenter (0.6.2) unstable; urgency=low
* adjust header's styles of iostat/nicstat tabs in top utility
* added support for pg_stat_database.checksum_failures (pg-12)
* added support of pg_stat_progress_cluster and pg_stat_progress_create_index views
* inject program version info from git at build time
Expand Down
8 changes: 4 additions & 4 deletions top/stat.go
Expand Up @@ -258,7 +258,7 @@ func printStatData(v *gocui.View, s *stat.Stat, filter bool) {
// Print iostat - block devices stats.
func printIostat(v *gocui.View, s stat.Diskstats) {
// print header
fmt.Fprintf(v, " \033[30;47mDevice: rrqm/s wrqm/s r/s w/s rMB/s wMB/s avgrq-sz avgqu-sz await r_await w_await %%util\033[0m\n")
fmt.Fprintf(v, "\033[30;47m Device: rrqm/s wrqm/s r/s w/s rMB/s wMB/s avgrq-sz avgqu-sz await r_await w_await %%util\033[0m\n")

for i := 0; i < len(s); i++ {
// skip devices which never do IOs
Expand All @@ -267,7 +267,7 @@ func printIostat(v *gocui.View, s stat.Diskstats) {
}

// print stats
fmt.Fprintf(v, "%14s\t%10.2f %10.2f %10.2f %10.2f %10.2f %10.2f %10.2f %10.2f %10.2f %10.2f %10.2f %10.2f\n",
fmt.Fprintf(v, "%20s\t%10.2f %10.2f %10.2f %10.2f %10.2f %10.2f %10.2f %10.2f %10.2f %10.2f %10.2f %10.2f\n",
s[i].Device,
s[i].Rmerged, s[i].Wmerged,
s[i].Rcompleted, s[i].Wcompleted,
Expand All @@ -280,7 +280,7 @@ func printIostat(v *gocui.View, s stat.Diskstats) {
// Print nicstat - network interfaces stat.
func printNicstat(v *gocui.View, s stat.Netdevs) {
// print header
fmt.Fprintf(v, " \033[30;47mInterface: rMbps wMbps rPk/s wPk/s rAvs wAvs IErr OErr Coll Sat %%rUtil %%wUtil %%Util\033[0m\n")
fmt.Fprintf(v, "\033[30;47m Interface: rMbps wMbps rPk/s wPk/s rAvs wAvs IErr OErr Coll Sat %%rUtil %%wUtil %%Util\033[0m\n")

for i := 0; i < len(s); i++ {
// skip interfaces which never seen packets
Expand All @@ -289,7 +289,7 @@ func printNicstat(v *gocui.View, s stat.Netdevs) {
}

// print stats
fmt.Fprintf(v, "%14s%8.2f%8.2f%9.2f%9.2f%9.2f%9.2f%9.2f%9.2f%9.2f%9.2f%9.2f%9.2f%9.2f\n",
fmt.Fprintf(v, "%20s%8.2f%8.2f%9.2f%9.2f%9.2f%9.2f%9.2f%9.2f%9.2f%9.2f%9.2f%9.2f%9.2f\n",
s[i].Ifname,
s[i].Rbytes/1024/128, s[i].Tbytes/1024/128, // conversion to Mbps
s[i].Rpackets, s[i].Tpackets, s[i].Raverage, s[i].Taverage,
Expand Down

0 comments on commit d170322

Please sign in to comment.