status

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Handles functions related to the current state of the network

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckBuildStatus

func CheckBuildStatus(buildId string) (string, error)

Check the current status of the build

func FindNodeIndex

func FindNodeIndex(status []NodeStatus, name string, serverId int) int

Finds the index of a node by name and server id

func GetClient

func GetClient(id int) (*ssh.Client, error)

GetClient retrieves the ssh client for running a command on a remote server based on server id. It will create one if it does not exist.

func GetClients

func GetClients(servers []int) ([]*ssh.Client, error)

GetClients functions similar to GetClient, except that it takes in an array of server ids and outputs an array of clients

func GetClientsFromNodes

func GetClientsFromNodes(nodes []db.Node) ([]*ssh.Client, error)

func GetLatestServers

func GetLatestServers(testnetId string) ([]db.Server, error)

Get the servers used in the latest testnet, populated with the ips of all the nodes

func GetNextTestNetId

func GetNextTestNetId() (string, error)

GetNextTestNetId gets the next testnet id. Used for getting the id of a testnet that is in progress of being built

Types

type BuildStatus

type BuildStatus struct {
	Error    state.CustomError `json:"error"`
	Progress float64           `json:"progress"`
	Stage    string            `json:"stage"`
	Frozen   bool              `json:"frozen"`
}

type Comp

type Comp struct {
	Cpu float64 `json:"cpu"`
	Vsz float64 `json:"virtualMemorySize"`
	Rss float64 `json:"residentSetSize"`
}

func SumResUsage

func SumResUsage(c *ssh.Client, name string) (Comp, error)

Gets the cpu usage of a node

type NodeStatus

type NodeStatus struct {
	Name      string `json:"name"`
	Server    int    `json:"server"`
	Ip        string `json:"ip"`
	Up        bool   `json:"up"`
	Resources Comp   `json:"resourceUse"`
}

Represents the status of the node

func CheckNodeStatus

func CheckNodeStatus(nodes []db.Node) ([]NodeStatus, error)

Checks the status of the nodes in the current testnet

Jump to

Keyboard shortcuts

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