Skip to content

Commit

Permalink
Revert "shows total memory usage"
Browse files Browse the repository at this point in the history
This reverts commit 1271ce9.
  • Loading branch information
bcicen committed Oct 25, 2020
1 parent dc14c79 commit c0db41e
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 19 deletions.
10 changes: 0 additions & 10 deletions cursor.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,6 @@ type GridCursor struct {

func (gc *GridCursor) Len() int { return len(gc.filtered) }

func (gc *GridCursor) MemoryUsage() int64 {
var size int64
size = 0
for _, c := range gc.filtered {
size += c.MemUsage
}
gc.Reset()
return size
}

func (gc *GridCursor) Selected() *container.Container {
idx := gc.Idx()
if idx < gc.Len() {
Expand Down
1 change: 0 additions & 1 deletion grid.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ func RedrawRows(clr bool) {
y := 1
if config.GetSwitchVal("enableHeader") {
header.SetCount(cursor.Len())
header.SetMemoryUsage(cursor.MemoryUsage())
header.SetFilter(config.GetVal("filterStr"))
y += header.Height()
}
Expand Down
9 changes: 1 addition & 8 deletions widgets/header.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ package widgets
import (
"fmt"
"time"
"github.com/bcicen/ctop/cwidgets"

ui "github.com/gizak/termui"
)

type CTopHeader struct {
Time *ui.Par
Count *ui.Par
Filter *ui.Par
Mem *ui.Par
bg *ui.Par
}

Expand All @@ -20,7 +19,6 @@ func NewCTopHeader() *CTopHeader {
Time: headerPar(2, ""),
Count: headerPar(24, "-"),
Filter: headerPar(40, ""),
Mem: headerPar(70, ""),
bg: headerBg(),
}
}
Expand All @@ -32,7 +30,6 @@ func (c *CTopHeader) Buffer() ui.Buffer {
buf.Merge(c.Time.Buffer())
buf.Merge(c.Count.Buffer())
buf.Merge(c.Filter.Buffer())
buf.Merge(c.Mem.Buffer())
return buf
}

Expand Down Expand Up @@ -61,10 +58,6 @@ func headerBg() *ui.Par {
return bg
}

func (c *CTopHeader) SetMemoryUsage(val int64) {
c.Mem.Text = cwidgets.ByteFormat(val)
}

func (c *CTopHeader) SetCount(val int) {
c.Count.Text = fmt.Sprintf("%d containers", val)
}
Expand Down

0 comments on commit c0db41e

Please sign in to comment.