cluster

package
v0.0.0-...-fa37e54 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2019 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HumanizeSeconds

func HumanizeSeconds(secs int64) string

Types

type ByName

type ByName []Node

func (ByName) Len

func (a ByName) Len() int

func (ByName) Less

func (a ByName) Less(i, j int) bool

func (ByName) Swap

func (a ByName) Swap(i, j int)

type Cluster

type Cluster struct {
	Nodes []Node `json:"nodes"`
}

func FilterByUser

func FilterByUser(c Cluster, username string) Cluster

func (*Cluster) FilterNodes

func (c *Cluster) FilterNodes(node_regex string)

func (*Cluster) Print

func (c *Cluster) Print(show_processes bool, show_time bool, timeout_threshold int, useColor bool, extended bool, show_detail bool)

func (*Cluster) Sort

func (c *Cluster) Sort()

type Device

type Device struct {
	Id                int    `json:"id"`
	Name              string `json:"name"`
	Utilization       int    `json:"utilization"`
	MemoryUtilization Memory `json:"memory"`
	FanSpeed          int    `json:"fan_speed"`
	Temperature       int    `json:"temperature"`
	PowerUsage        int    `json:"power_usage"`
	Processes         []Process
}

type Memory

type Memory struct {
	Used       int64 `json:"used"`
	Free       int64 `json:"free"`
	Total      int64 `json:"total"`
	Percentage int   `json:"percentage"`
}

type Node

type Node struct {
	Name       string    `json:"name"`       // hostname
	Devices    []Device  `json:"devices"`    // devices
	Time       time.Time `json:"time"`       // current timestamp from message
	BootTime   int64     `json:"boot_time"`  // uptime of system
	ClockTicks int64     `json:"clock_ticks` // cpu ticks per second
}

func (*Node) Print

func (n *Node) Print()

type Process

type Process struct {
	Pid             int
	UsedGpuMemory   int64
	Name            string
	Username        string
	RunTime         int64
	ExtendedCommand string
}

Jump to

Keyboard shortcuts

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