dasboard

package
v0.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2017 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Hub stream.Hub
)

Functions

This section is empty.

Types

type Cpu

type Cpu struct {
	Cpuinfo *Processors     `json:"processors"`
	All     float64         `json:"all"`
	Usage   map[int]float64 `json:"usage"`
	// contains filtered or unexported fields
}

func NewCpu

func NewCpu() (_cpu *Cpu)

func (*Cpu) Update

func (m *Cpu) Update()

type Dashboard

type Dashboard struct {
	Memory  *Memory
	Cpu     *Cpu
	Uptime  *Uptime
	Disk    *Disk
	Nodes   *Nodes
	Devices *Devices
	// contains filtered or unexported fields
}

func NewDashboard

func NewDashboard() *Dashboard

func (*Dashboard) Broadcast

func (t *Dashboard) Broadcast(pack string)

func (*Dashboard) BroadcastOne

func (t *Dashboard) BroadcastOne(pack string, id int64)

func (*Dashboard) GetStates

func (t *Dashboard) GetStates() *Dashboard

func (*Dashboard) Run

func (t *Dashboard) Run()

func (*Dashboard) Stop

func (t *Dashboard) Stop()

type Devices

type Devices struct {
	Total  int64                         `json:"total"`
	Status map[int64]*models.DeviceState `json:"status"`
}

func (*Devices) Broadcast

func (d *Devices) Broadcast() (interface{}, bool)

func (*Devices) BroadcastOne

func (d *Devices) BroadcastOne(id int64) (interface{}, bool)

func (*Devices) Update

func (d *Devices) Update()

type Disk

type Disk struct {
	Root *disk.UsageStat `json:"root"`
}

func NewDisk

func NewDisk() (_disk *Disk)

func (*Disk) Update

func (d *Disk) Update()

type Flow

type Flow struct {
}

func (*Flow) Update

func (f *Flow) Update()

type Memory

type Memory struct {
	SwapTotal uint64 `json:"swap_total"`
	SwapFree  uint64 `json:"swap_free"`
	MemTotal  uint64 `json:"mem_total"`
	MemFree   uint64 `json:"mem_free"`
}

func (*Memory) Update

func (m *Memory) Update()

type Nodes

type Nodes struct {
	sync.Mutex
	Total  int64            `json:"total"`
	Status map[int64]string `json:"status"`
}

func NewNode

func NewNode() (node *Nodes)

func (*Nodes) Broadcast

func (n *Nodes) Broadcast() (interface{}, bool)

func (*Nodes) Update

func (n *Nodes) Update()

type Processors

type Processors struct {
	Processors []cpu.InfoStat `json:"processors"`
}

type Uptime

type Uptime struct {
	Total uint64 `json:"total"`
	Idle  uint64 `json:"idle"`
}

func (*Uptime) Update

func (u *Uptime) Update() (*Uptime, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL