sysinfo

package
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IpAddressType_name = map[int32]string{
	0: "UNKNOWN_IPADDR_TYPE",
	1: "IPv4",
	2: "IPv6",
}
View Source
var IpAddressType_value = map[string]int32{
	"UNKNOWN_IPADDR_TYPE": 0,
	"IPv4":                1,
	"IPv6":                2,
}
View Source
var NetworkInterfaceType_name = map[int32]string{
	0: "UNKNOWN",
	1: "ETHERNET",
	2: "WIRELESS",
}
View Source
var NetworkInterfaceType_value = map[string]int32{
	"UNKNOWN":  0,
	"ETHERNET": 1,
	"WIRELESS": 2,
}

Functions

func GetCPULoad

func GetCPULoad(s *HealthInfo)

GetCPULoad will analyze the cpu load of this node and write the data into the given LocalDataDto.

func GetHardwareData

func GetHardwareData(w http.ResponseWriter)

GetHardwareData writes some statistics about this hardware into the given http response writer.

Types

type HealthInfo

type HealthInfo struct {
	TotalMemory          uint64   `protobuf:"varint,1,opt,name=totalMemory,proto3" json:"totalMemory,omitempty"`
	AvailableMemory      uint64   `protobuf:"varint,2,opt,name=availableMemory,proto3" json:"availableMemory,omitempty"`
	CpuLoad1             float64  `protobuf:"fixed64,3,opt,name=cpuLoad1,proto3" json:"cpuLoad1,omitempty"`
	CpuLoad5             float64  `protobuf:"fixed64,4,opt,name=cpuLoad5,proto3" json:"cpuLoad5,omitempty"`
	CpuLoad15            float64  `protobuf:"fixed64,5,opt,name=cpuLoad15,proto3" json:"cpuLoad15,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func GetNodeDetails

func GetNodeDetails() (data HealthInfo, err error)

GetNodeDetails returns all currently known information about this node.

func (*HealthInfo) Descriptor

func (*HealthInfo) Descriptor() ([]byte, []int)

func (*HealthInfo) GetAvailableMemory

func (m *HealthInfo) GetAvailableMemory() uint64

func (*HealthInfo) GetCpuLoad1

func (m *HealthInfo) GetCpuLoad1() float64

func (*HealthInfo) GetCpuLoad15

func (m *HealthInfo) GetCpuLoad15() float64

func (*HealthInfo) GetCpuLoad5

func (m *HealthInfo) GetCpuLoad5() float64

func (*HealthInfo) GetTotalMemory

func (m *HealthInfo) GetTotalMemory() uint64

func (*HealthInfo) ProtoMessage

func (*HealthInfo) ProtoMessage()

func (*HealthInfo) Reset

func (m *HealthInfo) Reset()

func (*HealthInfo) String

func (m *HealthInfo) String() string

func (*HealthInfo) XXX_DiscardUnknown

func (m *HealthInfo) XXX_DiscardUnknown()

func (*HealthInfo) XXX_Marshal

func (m *HealthInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*HealthInfo) XXX_Merge

func (m *HealthInfo) XXX_Merge(src proto.Message)

func (*HealthInfo) XXX_Size

func (m *HealthInfo) XXX_Size() int

func (*HealthInfo) XXX_Unmarshal

func (m *HealthInfo) XXX_Unmarshal(b []byte) error

type HostInfo

type HostInfo struct {
	HostName             string           `protobuf:"bytes,1,opt,name=HostName,proto3" json:"HostName,omitempty"`
	OsName               string           `protobuf:"bytes,2,opt,name=osName,proto3" json:"osName,omitempty"`
	OsVersion            string           `protobuf:"bytes,3,opt,name=osVersion,proto3" json:"osVersion,omitempty"`
	NumCores             uint32           `protobuf:"varint,4,opt,name=numCores,proto3" json:"numCores,omitempty"`
	FileSystems          []*PartitionInfo `protobuf:"bytes,5,rep,name=fileSystems,proto3" json:"fileSystems,omitempty"`
	XXX_NoUnkeyedLiteral struct{}         `json:"-"`
	XXX_unrecognized     []byte           `json:"-"`
	XXX_sizecache        int32            `json:"-"`
}

func GetHostInfo

func GetHostInfo() (hostInfo HostInfo)

func (*HostInfo) Descriptor

func (*HostInfo) Descriptor() ([]byte, []int)

func (*HostInfo) GetFileSystems

func (m *HostInfo) GetFileSystems() []*PartitionInfo

func (*HostInfo) GetHostName

func (m *HostInfo) GetHostName() string

func (*HostInfo) GetNumCores

func (m *HostInfo) GetNumCores() uint32

func (*HostInfo) GetOsName

func (m *HostInfo) GetOsName() string

func (*HostInfo) GetOsVersion

func (m *HostInfo) GetOsVersion() string

func (*HostInfo) ProtoMessage

func (*HostInfo) ProtoMessage()

func (*HostInfo) Reset

func (m *HostInfo) Reset()

func (*HostInfo) String

func (m *HostInfo) String() string

func (*HostInfo) XXX_DiscardUnknown

func (m *HostInfo) XXX_DiscardUnknown()

func (*HostInfo) XXX_Marshal

func (m *HostInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*HostInfo) XXX_Merge

func (m *HostInfo) XXX_Merge(src proto.Message)

func (*HostInfo) XXX_Size

func (m *HostInfo) XXX_Size() int

func (*HostInfo) XXX_Unmarshal

func (m *HostInfo) XXX_Unmarshal(b []byte) error

type IpAddress added in v1.1.0

type IpAddress struct {
	Address              string        `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
	Type                 IpAddressType `protobuf:"varint,2,opt,name=type,proto3,enum=sysinfo.IpAddressType" json:"type,omitempty"`
	XXX_NoUnkeyedLiteral struct{}      `json:"-"`
	XXX_unrecognized     []byte        `json:"-"`
	XXX_sizecache        int32         `json:"-"`
}

func (*IpAddress) Descriptor added in v1.1.0

func (*IpAddress) Descriptor() ([]byte, []int)

func (*IpAddress) GetAddress added in v1.1.0

func (m *IpAddress) GetAddress() string

func (*IpAddress) GetType added in v1.1.0

func (m *IpAddress) GetType() IpAddressType

func (*IpAddress) ProtoMessage added in v1.1.0

func (*IpAddress) ProtoMessage()

func (*IpAddress) Reset added in v1.1.0

func (m *IpAddress) Reset()

func (*IpAddress) String added in v1.1.0

func (m *IpAddress) String() string

func (*IpAddress) XXX_DiscardUnknown added in v1.1.0

func (m *IpAddress) XXX_DiscardUnknown()

func (*IpAddress) XXX_Marshal added in v1.1.0

func (m *IpAddress) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*IpAddress) XXX_Merge added in v1.1.0

func (m *IpAddress) XXX_Merge(src proto.Message)

func (*IpAddress) XXX_Size added in v1.1.0

func (m *IpAddress) XXX_Size() int

func (*IpAddress) XXX_Unmarshal added in v1.1.0

func (m *IpAddress) XXX_Unmarshal(b []byte) error

type IpAddressType added in v1.1.0

type IpAddressType int32
const (
	IpAddressType_UNKNOWN_IPADDR_TYPE IpAddressType = 0
	IpAddressType_IPv4                IpAddressType = 1
	IpAddressType_IPv6                IpAddressType = 2
)

func (IpAddressType) EnumDescriptor added in v1.1.0

func (IpAddressType) EnumDescriptor() ([]byte, []int)

func (IpAddressType) String added in v1.1.0

func (x IpAddressType) String() string

type NetworkInterfaceData added in v1.1.0

type NetworkInterfaceData struct {
	Name                 string               `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	DeviceName           string               `protobuf:"bytes,2,opt,name=deviceName,proto3" json:"deviceName,omitempty"`
	Type                 NetworkInterfaceType `protobuf:"varint,3,opt,name=type,proto3,enum=sysinfo.NetworkInterfaceType" json:"type,omitempty"`
	HwAddr               string               `protobuf:"bytes,4,opt,name=hwAddr,proto3" json:"hwAddr,omitempty"`
	Mtu                  uint32               `protobuf:"varint,5,opt,name=mtu,proto3" json:"mtu,omitempty"`
	Address              []*IpAddress         `protobuf:"bytes,6,rep,name=address,proto3" json:"address,omitempty"`
	XXX_NoUnkeyedLiteral struct{}             `json:"-"`
	XXX_unrecognized     []byte               `json:"-"`
	XXX_sizecache        int32                `json:"-"`
}

func GetLocalNetworkInterfaces added in v1.1.0

func GetLocalNetworkInterfaces() ([]NetworkInterfaceData, error)

GetLocalNetworkInterfaces returns all known local network interfaces

func (*NetworkInterfaceData) Descriptor added in v1.1.0

func (*NetworkInterfaceData) Descriptor() ([]byte, []int)

func (*NetworkInterfaceData) GetAddress added in v1.1.0

func (m *NetworkInterfaceData) GetAddress() []*IpAddress

func (*NetworkInterfaceData) GetDeviceName added in v1.1.0

func (m *NetworkInterfaceData) GetDeviceName() string

func (*NetworkInterfaceData) GetHwAddr added in v1.1.0

func (m *NetworkInterfaceData) GetHwAddr() string

func (*NetworkInterfaceData) GetMtu added in v1.1.0

func (m *NetworkInterfaceData) GetMtu() uint32

func (*NetworkInterfaceData) GetName added in v1.1.0

func (m *NetworkInterfaceData) GetName() string

func (*NetworkInterfaceData) GetType added in v1.1.0

func (*NetworkInterfaceData) ProtoMessage added in v1.1.0

func (*NetworkInterfaceData) ProtoMessage()

func (*NetworkInterfaceData) Reset added in v1.1.0

func (m *NetworkInterfaceData) Reset()

func (*NetworkInterfaceData) String added in v1.1.0

func (m *NetworkInterfaceData) String() string

func (*NetworkInterfaceData) XXX_DiscardUnknown added in v1.1.0

func (m *NetworkInterfaceData) XXX_DiscardUnknown()

func (*NetworkInterfaceData) XXX_Marshal added in v1.1.0

func (m *NetworkInterfaceData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*NetworkInterfaceData) XXX_Merge added in v1.1.0

func (m *NetworkInterfaceData) XXX_Merge(src proto.Message)

func (*NetworkInterfaceData) XXX_Size added in v1.1.0

func (m *NetworkInterfaceData) XXX_Size() int

func (*NetworkInterfaceData) XXX_Unmarshal added in v1.1.0

func (m *NetworkInterfaceData) XXX_Unmarshal(b []byte) error

type NetworkInterfaceType added in v1.1.0

type NetworkInterfaceType int32
const (
	NetworkInterfaceType_UNKNOWN  NetworkInterfaceType = 0
	NetworkInterfaceType_ETHERNET NetworkInterfaceType = 1
	NetworkInterfaceType_WIRELESS NetworkInterfaceType = 2
)

func (NetworkInterfaceType) EnumDescriptor added in v1.1.0

func (NetworkInterfaceType) EnumDescriptor() ([]byte, []int)

func (NetworkInterfaceType) String added in v1.1.0

func (x NetworkInterfaceType) String() string

type PartitionInfo

type PartitionInfo struct {
	MountPath            string   `protobuf:"bytes,1,opt,name=MountPath,proto3" json:"MountPath,omitempty"`
	Size                 uint64   `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"`
	Free                 uint64   `protobuf:"varint,3,opt,name=free,proto3" json:"free,omitempty"`
	FsType               string   `protobuf:"bytes,4,opt,name=fsType,proto3" json:"fsType,omitempty"`
	Device               string   `protobuf:"bytes,5,opt,name=device,proto3" json:"device,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func GetDiskSizeInfo

func GetDiskSizeInfo(thisPath string) (disk PartitionInfo, err error)

GetDiskSizeInfo returns the disk info for a given linux path

func (*PartitionInfo) Descriptor

func (*PartitionInfo) Descriptor() ([]byte, []int)

func (*PartitionInfo) GetDevice

func (m *PartitionInfo) GetDevice() string

func (*PartitionInfo) GetFree

func (m *PartitionInfo) GetFree() uint64

func (*PartitionInfo) GetFsType

func (m *PartitionInfo) GetFsType() string

func (*PartitionInfo) GetMountPath

func (m *PartitionInfo) GetMountPath() string

func (*PartitionInfo) GetSize

func (m *PartitionInfo) GetSize() uint64

func (*PartitionInfo) ProtoMessage

func (*PartitionInfo) ProtoMessage()

func (*PartitionInfo) Reset

func (m *PartitionInfo) Reset()

func (*PartitionInfo) String

func (m *PartitionInfo) String() string

func (*PartitionInfo) XXX_DiscardUnknown

func (m *PartitionInfo) XXX_DiscardUnknown()

func (*PartitionInfo) XXX_Marshal

func (m *PartitionInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PartitionInfo) XXX_Merge

func (m *PartitionInfo) XXX_Merge(src proto.Message)

func (*PartitionInfo) XXX_Size

func (m *PartitionInfo) XXX_Size() int

func (*PartitionInfo) XXX_Unmarshal

func (m *PartitionInfo) XXX_Unmarshal(b []byte) error

type ProcessDetails added in v1.1.0

type ProcessDetails struct {
	ProcessId            uint64   `protobuf:"varint,1,opt,name=processId,proto3" json:"processId,omitempty"`
	Path                 string   `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ProcessDetails) Descriptor added in v1.1.0

func (*ProcessDetails) Descriptor() ([]byte, []int)

func (*ProcessDetails) GetPath added in v1.1.0

func (m *ProcessDetails) GetPath() string

func (*ProcessDetails) GetProcessId added in v1.1.0

func (m *ProcessDetails) GetProcessId() uint64

func (*ProcessDetails) ProtoMessage added in v1.1.0

func (*ProcessDetails) ProtoMessage()

func (*ProcessDetails) Reset added in v1.1.0

func (m *ProcessDetails) Reset()

func (*ProcessDetails) String added in v1.1.0

func (m *ProcessDetails) String() string

func (*ProcessDetails) XXX_DiscardUnknown added in v1.1.0

func (m *ProcessDetails) XXX_DiscardUnknown()

func (*ProcessDetails) XXX_Marshal added in v1.1.0

func (m *ProcessDetails) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ProcessDetails) XXX_Merge added in v1.1.0

func (m *ProcessDetails) XXX_Merge(src proto.Message)

func (*ProcessDetails) XXX_Size added in v1.1.0

func (m *ProcessDetails) XXX_Size() int

func (*ProcessDetails) XXX_Unmarshal added in v1.1.0

func (m *ProcessDetails) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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