winstats

package
v1.27.0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2023 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package winstats provides a client to get node and pod level stats on windows

Package winstats provides a client to get node and pod level stats on windows

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProcessorCount added in v1.27.0

func ProcessorCount() int

runtime.NumCPU() will only return the information for a single Processor Group. Since a single group can only hold 64 logical processors, this means when there are more they will be divided into multiple groups. For the above reason, procGetActiveProcessorCount is used to get the cpu count for all processor groups of the windows node. more notes for this issue: same issue in moby: https://github.com/moby/moby/issues/38935#issuecomment-744638345 solution in hcsshim: https://github.com/microsoft/hcsshim/blob/master/internal/processorinfo/processor_count.go

Types

type Client

type Client interface {
	WinContainerInfos() (map[string]cadvisorapiv2.ContainerInfo, error)
	WinMachineInfo() (*cadvisorapi.MachineInfo, error)
	WinVersionInfo() (*cadvisorapi.VersionInfo, error)
	GetDirFsInfo(path string) (cadvisorapiv2.FsInfo, error)
}

Client is an interface that is used to get stats information.

func NewPerfCounterClient

func NewPerfCounterClient() (Client, error)

NewPerfCounterClient creates a client using perf counters

type MemoryStatusEx added in v1.9.4

type MemoryStatusEx struct {
	Length               uint32
	MemoryLoad           uint32
	TotalPhys            uint64
	AvailPhys            uint64
	TotalPageFile        uint64
	AvailPageFile        uint64
	TotalVirtual         uint64
	AvailVirtual         uint64
	AvailExtendedVirtual uint64
}

MemoryStatusEx is the same as Windows structure MEMORYSTATUSEX https://msdn.microsoft.com/en-us/library/windows/desktop/aa366770(v=vs.85).aspx

type OSInfo added in v1.17.0

type OSInfo struct {
	BuildNumber, ProductName        string
	MajorVersion, MinorVersion, UBR uint64
}

OSInfo is a convenience class for retrieving Windows OS information

func GetOSInfo added in v1.17.0

func GetOSInfo() (*OSInfo, error)

GetOSInfo reads Windows version information from the registry

func (*OSInfo) GetBuild added in v1.17.0

func (o *OSInfo) GetBuild() string

GetBuild returns OS version upto build number

func (*OSInfo) GetPatchVersion added in v1.17.0

func (o *OSInfo) GetPatchVersion() string

GetPatchVersion returns full OS version with patch

type StatsClient added in v1.10.0

type StatsClient struct {
	// contains filtered or unexported fields
}

StatsClient is a client that implements the Client interface

func (*StatsClient) GetDirFsInfo added in v1.10.0

func (c *StatsClient) GetDirFsInfo(path string) (cadvisorapiv2.FsInfo, error)

GetDirFsInfo returns filesystem capacity and usage information.

func (*StatsClient) WinContainerInfos added in v1.10.0

func (c *StatsClient) WinContainerInfos() (map[string]cadvisorapiv2.ContainerInfo, error)

WinContainerInfos returns a map of container infos. The map contains node and pod level stats. Analogous to cadvisor GetContainerInfoV2 method.

func (*StatsClient) WinMachineInfo added in v1.10.0

func (c *StatsClient) WinMachineInfo() (*cadvisorapi.MachineInfo, error)

WinMachineInfo returns a cadvisorapi.MachineInfo with details about the node machine. Analogous to cadvisor MachineInfo method.

func (*StatsClient) WinVersionInfo added in v1.10.0

func (c *StatsClient) WinVersionInfo() (*cadvisorapi.VersionInfo, error)

WinVersionInfo returns a cadvisorapi.VersionInfo with version info of the kernel and docker runtime. Analogous to cadvisor VersionInfo method.

Jump to

Keyboard shortcuts

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