func (n *DockerStatusWidget) Activate() {
	go func() {
		for _, g := range n.gauges {
			if !g.active {
				return
			}
			if g.metrics == "cpu" {
				r, err := n.readCPU(g)
				if err != nil {
					panic(err)
				}
				per := strconv.FormatFloat(r, 'f', 2, 64)
				g.gauge.Percent = int(r)
				g.gauge.Label = per + "% "
			} else if g.metrics == "memory" {
				m, l, err := n.readMemory(g.id)
				if err != nil {
					panic(err)
				}
				g.gauge.Percent = m
				lim := humanize.Comma(l / 1000 / 1000)
				g.gauge.Label = "{{percent}}% (" + lim + "MBs) "
			}
			ui.Render(ui.Body)
		}
	}()
	return
}
// Activate is the implementation of Widget.Activate
Activate is the implementation of Widget.Activate
// Activate is the implementation of Widget . Activate
func (n *DockerStatusWidget) Activate() {
	go func() {
		for _, g := range n.gauges {
			if !g.active {
				return
			}
			if g.metrics == "cpu" {
				r, err := n.readCPU(g)
				if err != nil {
					panic(err)
				}
				per := strconv.FormatFloat(r, 'f', 2, 64)
				g.gauge.Percent = int(r)
				g.gauge.Label = per + "% "
			} else if g.metrics == "memory" {
				m, l, err := n.readMemory(g.id)
				if err != nil {
					panic(err)
				}
				g.gauge.Percent = m
				lim := humanize.Comma(l / 1000 / 1000)
				g.gauge.Label = "{{percent}}% (" + lim + "MBs) "
			}
			ui.Render(ui.Body)
		}
	}()
	return
}
func ( n * DockerStatusWidget ) Activate ( ) { go func ( ) { for _ , g := range n . gauges { if ! g . active { return } if g . metrics == " " { r , err := n . readCPU ( g ) if err != nil { panic ( err ) } per := strconv . FormatFloat ( r , 'f' , 2 , 64 ) g . gauge . Percent = int ( r ) g . gauge . Label = per + " " } else if g . metrics == " " { m , l , err := n . readMemory ( g . id ) if err != nil { panic ( err ) } g . gauge . Percent = m lim := humanize . Comma ( l / 1000 / 1000 ) g . gauge . Label = " " + lim + " " } ui . Render ( ui . Body ) } } ( ) return }
Activate is the implementation of Widget.Activate
Activate is the implementation of Widget . Activate