sysinfo

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2022 License: Apache-2.0 Imports: 16 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",
	}
	IpAddressType_value = map[string]int32{
		"UNKNOWN_IPADDR_TYPE": 0,
		"IPv4":                1,
		"IPv6":                2,
	}
)

Enum value maps for IpAddressType.

View Source
var (
	NetworkInterfaceType_name = map[int32]string{
		0: "UNKNOWN",
		1: "ETHERNET",
		2: "WIRELESS",
	}
	NetworkInterfaceType_value = map[string]int32{
		"UNKNOWN":  0,
		"ETHERNET": 1,
		"WIRELESS": 2,
	}
)

Enum value maps for NetworkInterfaceType.

View Source
var File_sysinfo_types_proto protoreflect.FileDescriptor

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"`
	// contains filtered or unexported fields
}

func GetNodeDetails

func GetNodeDetails() (*HealthInfo, error)

GetNodeDetails returns all currently known information about this node.

func (*HealthInfo) Descriptor deprecated

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

Deprecated: Use HealthInfo.ProtoReflect.Descriptor instead.

func (*HealthInfo) GetAvailableMemory

func (x *HealthInfo) GetAvailableMemory() uint64

func (*HealthInfo) GetCpuLoad1

func (x *HealthInfo) GetCpuLoad1() float64

func (*HealthInfo) GetCpuLoad15

func (x *HealthInfo) GetCpuLoad15() float64

func (*HealthInfo) GetCpuLoad5

func (x *HealthInfo) GetCpuLoad5() float64

func (*HealthInfo) GetTotalMemory

func (x *HealthInfo) GetTotalMemory() uint64

func (*HealthInfo) ProtoMessage

func (*HealthInfo) ProtoMessage()

func (*HealthInfo) ProtoReflect added in v1.2.3

func (x *HealthInfo) ProtoReflect() protoreflect.Message

func (*HealthInfo) Reset

func (x *HealthInfo) Reset()

func (*HealthInfo) String

func (x *HealthInfo) String() string

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"`
	// contains filtered or unexported fields
}

func GetHostInfo

func GetHostInfo() *HostInfo

func (*HostInfo) Descriptor deprecated

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

Deprecated: Use HostInfo.ProtoReflect.Descriptor instead.

func (*HostInfo) GetFileSystems

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

func (*HostInfo) GetHostName

func (x *HostInfo) GetHostName() string

func (*HostInfo) GetNumCores

func (x *HostInfo) GetNumCores() uint32

func (*HostInfo) GetOsName

func (x *HostInfo) GetOsName() string

func (*HostInfo) GetOsVersion

func (x *HostInfo) GetOsVersion() string

func (*HostInfo) ProtoMessage

func (*HostInfo) ProtoMessage()

func (*HostInfo) ProtoReflect added in v1.2.3

func (x *HostInfo) ProtoReflect() protoreflect.Message

func (*HostInfo) Reset

func (x *HostInfo) Reset()

func (*HostInfo) String

func (x *HostInfo) String() string

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"`
	// contains filtered or unexported fields
}

func (*IpAddress) Descriptor deprecated added in v1.1.0

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

Deprecated: Use IpAddress.ProtoReflect.Descriptor instead.

func (*IpAddress) GetAddress added in v1.1.0

func (x *IpAddress) GetAddress() string

func (*IpAddress) GetType added in v1.1.0

func (x *IpAddress) GetType() IpAddressType

func (*IpAddress) ProtoMessage added in v1.1.0

func (*IpAddress) ProtoMessage()

func (*IpAddress) ProtoReflect added in v1.2.3

func (x *IpAddress) ProtoReflect() protoreflect.Message

func (*IpAddress) Reset added in v1.1.0

func (x *IpAddress) Reset()

func (*IpAddress) String added in v1.1.0

func (x *IpAddress) String() string

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) Descriptor added in v1.2.3

func (IpAddressType) Enum added in v1.2.3

func (x IpAddressType) Enum() *IpAddressType

func (IpAddressType) EnumDescriptor deprecated added in v1.1.0

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

Deprecated: Use IpAddressType.Descriptor instead.

func (IpAddressType) Number added in v1.2.3

func (IpAddressType) String added in v1.1.0

func (x IpAddressType) String() string

func (IpAddressType) Type added in v1.2.3

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"`
	// contains filtered or unexported fields
}

func GetLocalNetworkInterfaces added in v1.1.0

func GetLocalNetworkInterfaces() ([]*NetworkInterfaceData, error)

GetLocalNetworkInterfaces returns all known local network interfaces

func (*NetworkInterfaceData) Descriptor deprecated added in v1.1.0

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

Deprecated: Use NetworkInterfaceData.ProtoReflect.Descriptor instead.

func (*NetworkInterfaceData) GetAddress added in v1.1.0

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

func (*NetworkInterfaceData) GetDeviceName added in v1.1.0

func (x *NetworkInterfaceData) GetDeviceName() string

func (*NetworkInterfaceData) GetHwAddr added in v1.1.0

func (x *NetworkInterfaceData) GetHwAddr() string

func (*NetworkInterfaceData) GetMtu added in v1.1.0

func (x *NetworkInterfaceData) GetMtu() uint32

func (*NetworkInterfaceData) GetName added in v1.1.0

func (x *NetworkInterfaceData) GetName() string

func (*NetworkInterfaceData) GetType added in v1.1.0

func (*NetworkInterfaceData) ProtoMessage added in v1.1.0

func (*NetworkInterfaceData) ProtoMessage()

func (*NetworkInterfaceData) ProtoReflect added in v1.2.3

func (x *NetworkInterfaceData) ProtoReflect() protoreflect.Message

func (*NetworkInterfaceData) Reset added in v1.1.0

func (x *NetworkInterfaceData) Reset()

func (*NetworkInterfaceData) String added in v1.1.0

func (x *NetworkInterfaceData) String() string

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) Descriptor added in v1.2.3

func (NetworkInterfaceType) Enum added in v1.2.3

func (NetworkInterfaceType) EnumDescriptor deprecated added in v1.1.0

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

Deprecated: Use NetworkInterfaceType.Descriptor instead.

func (NetworkInterfaceType) Number added in v1.2.3

func (NetworkInterfaceType) String added in v1.1.0

func (x NetworkInterfaceType) String() string

func (NetworkInterfaceType) Type added in v1.2.3

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"`
	// contains filtered or unexported fields
}

func GetDiskSizeInfo

func GetDiskSizeInfo(thisPath string) (*PartitionInfo, error)

GetDiskSizeInfo returns the disk info for a given linux path

func (*PartitionInfo) Descriptor deprecated

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

Deprecated: Use PartitionInfo.ProtoReflect.Descriptor instead.

func (*PartitionInfo) GetDevice

func (x *PartitionInfo) GetDevice() string

func (*PartitionInfo) GetFree

func (x *PartitionInfo) GetFree() uint64

func (*PartitionInfo) GetFsType

func (x *PartitionInfo) GetFsType() string

func (*PartitionInfo) GetMountPath

func (x *PartitionInfo) GetMountPath() string

func (*PartitionInfo) GetSize

func (x *PartitionInfo) GetSize() uint64

func (*PartitionInfo) ProtoMessage

func (*PartitionInfo) ProtoMessage()

func (*PartitionInfo) ProtoReflect added in v1.2.3

func (x *PartitionInfo) ProtoReflect() protoreflect.Message

func (*PartitionInfo) Reset

func (x *PartitionInfo) Reset()

func (*PartitionInfo) String

func (x *PartitionInfo) String() string

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"`
	// contains filtered or unexported fields
}

func (*ProcessDetails) Descriptor deprecated added in v1.1.0

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

Deprecated: Use ProcessDetails.ProtoReflect.Descriptor instead.

func (*ProcessDetails) GetPath added in v1.1.0

func (x *ProcessDetails) GetPath() string

func (*ProcessDetails) GetProcessId added in v1.1.0

func (x *ProcessDetails) GetProcessId() uint64

func (*ProcessDetails) ProtoMessage added in v1.1.0

func (*ProcessDetails) ProtoMessage()

func (*ProcessDetails) ProtoReflect added in v1.2.3

func (x *ProcessDetails) ProtoReflect() protoreflect.Message

func (*ProcessDetails) Reset added in v1.1.0

func (x *ProcessDetails) Reset()

func (*ProcessDetails) String added in v1.1.0

func (x *ProcessDetails) String() string

Jump to

Keyboard shortcuts

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