clustertab

package
v0.0.0-...-9d695bc Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2022 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Width of the SinfoTable, used in calculating Stats box width.
	// Must be adjusted alongside SinfoTabCols changes.
	//SinfoTabWidth = 118
	SinfoTabWidth = 134
)

Variables

View Source
var (
	SinfoCmdSwitches = []string{"-a", "--json"}
)
View Source
var SinfoTabCols = []table.Column{
	{
		Title: "Name",
		Width: 15,
	},
	{
		Title: "Part.",
		Width: 5,
	},
	{
		Title: "State",
		Width: 10,
	},
	{
		Title: "CPUAvail",
		Width: 8,
	},
	{
		Title: "CPUTotal",
		Width: 8,
	},
	{
		Title: "MEMAvail",
		Width: 10,
	},
	{
		Title: "MEMTotal",
		Width: 10,
	},
	{
		Title: "GPUAvail",
		Width: 8,
	},
	{
		Title: "GPUTotal",
		Width: 8,
	},
	{
		Title: "State FLAGS",
		Width: 15,
	},
}
View Source
var SinfoTabRows = []table.Row{}

TODO: not sure what i was thinking, but this we really don't need, just inject in Update() directly to model!?

Functions

func GetSinfo

func GetSinfo(t time.Time) tea.Msg

Calls `sinfo` to get node information for Cluster Tab

func NewCmdCC

func NewCmdCC(config config.ConfigContainer)

func QuickGetSinfo

func QuickGetSinfo(l *log.Logger) tea.Cmd

func TimedGetSinfo

func TimedGetSinfo(l *log.Logger) tea.Cmd

Types

type Breakdowns

type Breakdowns struct {
	CpuPerPart    generic.CountItemSlice
	MemPerPart    generic.CountItemSlice
	GpuPerPart    generic.CountItemSlice
	NodesPerState generic.CountItemSlice
}

type ClusterTab

type ClusterTab struct {
	StatsOn       bool
	CountsOn      bool
	FilterOn      bool
	SinfoTable    table.Model
	CpuBar        progress.Model
	MemBar        progress.Model
	GpuBar        progress.Model
	Sinfo         SinfoJSON
	SinfoFiltered SinfoJSON
	Filter        textinput.Model
	Stats
	Breakdowns
}

func (*ClusterTab) AdjTableHeight

func (t *ClusterTab) AdjTableHeight(h int, l *log.Logger)

func (*ClusterTab) ClusterTabStats

func (ct *ClusterTab) ClusterTabStats(l *log.Logger) string

func (*ClusterTab) GetStatsFiltered

func (t *ClusterTab) GetStatsFiltered(l *log.Logger)

func (*ClusterTab) View

func (ct *ClusterTab) View(l *log.Logger) string

type Keys

type Keys map[*key.Binding]bool

func (*Keys) SetupKeys

func (k *Keys) SetupKeys()

type SinfoJSON

type SinfoJSON slurm.SinfoJSON

func (*SinfoJSON) FilterSinfoTable

func (siJson *SinfoJSON) FilterSinfoTable(f string, l *log.Logger) (*TableRows, *SinfoJSON, *command.ErrorMsg)

type Stats

type Stats struct {
	// TODO: also perhaps: count by user? account?
	StateCnt       map[string]uint
	StateSimpleCnt map[string]uint
}

type TableRows

type TableRows []table.Row

Jump to

Keyboard shortcuts

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