diff options
author | obscuren <geffobscura@gmail.com> | 2014-08-23 17:00:15 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-08-23 17:00:15 +0800 |
commit | ded013b7a7367f74b9c854755a7ce4a6955e93c0 (patch) | |
tree | 46d4c059fb4bfcc3be6ae2d752bfb5cbee6aaab3 /ethereal/gui.go | |
parent | 5ac875b097a55c75a7e3da3443ef9fe64fc87846 (diff) | |
download | dexon-ded013b7a7367f74b9c854755a7ce4a6955e93c0.tar.gz dexon-ded013b7a7367f74b9c854755a7ce4a6955e93c0.tar.zst dexon-ded013b7a7367f74b9c854755a7ce4a6955e93c0.zip |
Minor updates to the UI
Diffstat (limited to 'ethereal/gui.go')
-rw-r--r-- | ethereal/gui.go | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/ethereal/gui.go b/ethereal/gui.go index 5e87f7464..4849fbab7 100644 --- a/ethereal/gui.go +++ b/ethereal/gui.go @@ -6,6 +6,7 @@ import ( "fmt" "math/big" "os" + "runtime" "strconv" "strings" "time" @@ -412,6 +413,7 @@ func (gui *Gui) update() { peerUpdateTicker := time.NewTicker(5 * time.Second) generalUpdateTicker := time.NewTicker(1 * time.Second) + statsUpdateTicker := time.NewTicker(5 * time.Second) state := gui.eth.StateManager().TransState() @@ -488,6 +490,10 @@ func (gui *Gui) update() { pow := gui.miner.GetPow() miningLabel.Set("text", "Mining @ "+strconv.FormatInt(pow.GetHashrate(), 10)+"Khash") } + + case <-statsUpdateTicker.C: + gui.setStatsPane() + } } }() @@ -507,6 +513,28 @@ func (gui *Gui) update() { reactor.Subscribe("peerList", peerChan) } +func (gui *Gui) setStatsPane() { + var memStats runtime.MemStats + runtime.ReadMemStats(&memStats) + + statsPane := gui.getObjectByName("statsPane") + statsPane.Set("text", fmt.Sprintf(`###### Ethereal 0.6.4 (%s) ####### + +CPU: # %d +Goroutines: # %d +CGoCalls: # %d + +Alloc: %d +Heap Alloc: %d + +CGNext: %x +NumGC: %d +`, runtime.Version(), runtime.NumCPU, runtime.NumGoroutine(), runtime.NumCgoCall(), + memStats.Alloc, memStats.HeapAlloc, + memStats.NextGC, memStats.NumGC, + )) +} + func (gui *Gui) CopyToClipboard(data string) { //clipboard.WriteAll("test") fmt.Println("COPY currently BUGGED. Here are the contents:\n", data) |