sights

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildSight

type BuildSight interface {
	Init(context.Context) error
	Deinit(context.Context) error
	Run(context.Context) error
}

func BuildSightNew

func BuildSightNew(_ context.Context, cfg *BuildSightConfig) BuildSight

type BuildSightConfig

type BuildSightConfig struct {
	Config config.Config
	Logger hclog.Logger
	Gpt    gpt.Gpt
	Repo   repo.Repo
	Review review.Review
}

func DefaultBuildSightConfig

func DefaultBuildSightConfig() *BuildSightConfig

type CgroupDockerStat added in v0.8.0

type CgroupDockerStat struct {
	ContainerId string `json:"containerId"`
	Name        string `json:"name"`
	Image       string `json:"image"`
	Status      string `json:"status"`
	Running     bool   `json:"running"`
}

type CgroupMemDocker added in v0.8.0

type CgroupMemDocker struct {
	Cache              uint64 `json:"cache"`
	Rss                uint64 `json:"rss"`
	RssHuge            uint64 `json:"rssHuge"`
	MappedFile         uint64 `json:"mappedFile"`
	TotalCache         uint64 `json:"totalCache"`
	TotalRss           uint64 `json:"totalRss"`
	TotalRssHuge       uint64 `json:"totalRssHuge"`
	TotalMappedFile    uint64 `json:"totalMappedFile"`
	MemUsageInBytes    uint64 `json:"memUsageInBytes"`
	MemMaxUsageInBytes uint64 `json:"memMaxUsageInBytes"`
	MemLimitInBytes    uint64 `json:"memLimitInBytes"`
}

type CodeSight

type CodeSight interface {
	Init(context.Context) error
	Deinit(context.Context) error
	Run(context.Context) error
}

func CodeSightNew

func CodeSightNew(_ context.Context, cfg *CodeSightConfig) CodeSight

type CodeSightConfig

type CodeSightConfig struct {
	Config config.Config
	Logger hclog.Logger
	Gpt    gpt.Gpt
	Repo   repo.Repo
	Review review.Review
}

func DefaultCodeSightConfig

func DefaultCodeSightConfig() *CodeSightConfig

type CpuStat added in v0.5.0

type CpuStat struct {
	PhysicalCount int64     `json:"physicalCount"`
	LogicalCount  int64     `json:"logicalCount"`
	CpuPercents   []float64 `json:"cpuPercents"`
	CpuTimes      []CpuTime `json:"cpuTimes"`
}

type CpuTime added in v0.5.0

type CpuTime struct {
	Cpu       string  `json:"cpu"`
	User      float64 `json:"user"`
	System    float64 `json:"system"`
	Idle      float64 `json:"idle"`
	Nice      float64 `json:"nice"`
	Iowait    float64 `json:"iowait"`
	Irq       float64 `json:"irq"`
	Softirq   float64 `json:"softirq"`
	Steal     float64 `json:"steal"`
	Guest     float64 `json:"guest"`
	GuestNice float64 `json:"guestNice"`
}

type DiskPartition added in v0.5.0

type DiskPartition struct {
	Device     string   `json:"device"`
	Mountpoint string   `json:"mountpoint"`
	Fstype     string   `json:"fstype"`
	Opts       []string `json:"opts"`
}

type DiskStat added in v0.5.0

type DiskStat struct {
	DiskPartitions []DiskPartition `json:"diskPartitions"`
	DiskUsage      DiskUsage       `json:"diskUsage"`
}

type DiskUsage added in v0.5.0

type DiskUsage struct {
	Path        string  `json:"path"`
	Fstype      string  `json:"fstype"`
	Total       uint64  `json:"total"`
	Free        uint64  `json:"free"`
	Used        uint64  `json:"used"`
	UsedPercent float64 `json:"usedPercent"`
}

type DockerStat added in v0.5.0

type DockerStat struct {
	CgroupCpuDockerUsages []float64          `json:"cgroupCpuDockerUsages"`
	CgroupDockerStats     []CgroupDockerStat `json:"cgroupDockerStats"`
	CgroupMemDockers      []CgroupMemDocker  `json:"cgroupMemDockers"`
}

type HostStat added in v0.5.0

type HostStat struct {
	Hostname        string `json:"hostname"`
	Procs           uint64 `json:"procs"`
	Os              string `json:"os"`
	Platform        string `json:"platform"`
	PlatformFamily  string `json:"platformFamily"`
	PlatformVersion string `json:"platformVersion"`
	KernelVersion   string `json:"kernelVersion"`
	KernelArch      string `json:"kernelArch"`
	HostID          string `json:"hostID"`
}

type LoadAvg added in v0.5.0

type LoadAvg struct {
	Load1  float64 `json:"load1"`
	Load5  float64 `json:"load5"`
	Load15 float64 `json:"load15"`
}

type LoadMisc added in v0.5.0

type LoadMisc struct {
	ProcsTotal   int64 `json:"procsTotal"`
	ProcsCreated int64 `json:"procsCreated"`
	ProcsRunning int64 `json:"procsRunning"`
	ProcsBlocked int64 `json:"procsBlocked"`
	Ctxt         int64 `json:"ctxt"`
}

type LoadStat added in v0.5.0

type LoadStat struct {
	LoadAvg  LoadAvg  `json:"loadAvg"`
	LoadMisc LoadMisc `json:"loadMisc"`
}

type MemStat added in v0.5.0

type MemStat struct {
	MemSwapDevices []MemSwapDevice `json:"memSwapDevices"`
	MemSwapMemory  MemSwapMemory   `json:"memSwapMemory"`
	MemVirtual     MemVirtual      `json:"memVirtual"`
}

type MemSwapDevice added in v0.5.0

type MemSwapDevice struct {
	Name      string `json:"name"`
	UsedBytes uint64 `json:"usedBytes"`
	FreeBytes uint64 `json:"freeBytes"`
}

type MemSwapMemory added in v0.5.0

type MemSwapMemory struct {
	Total       uint64  `json:"total"`
	Used        uint64  `json:"used"`
	Free        uint64  `json:"free"`
	UsedPercent float64 `json:"usedPercent"`
}

type MemVirtual added in v0.5.0

type MemVirtual struct {
	Total          uint64  `json:"total"`
	Available      uint64  `json:"available"`
	Used           uint64  `json:"used"`
	UsedPercent    float64 `json:"usedPercent"`
	Free           uint64  `json:"free"`
	Buffer         uint64  `json:"buffer"`
	Cached         uint64  `json:"cached"`
	SwapCached     uint64  `json:"swapCached"`
	SwapTotal      uint64  `json:"swapTotal"`
	SwapFree       uint64  `json:"swapFree"`
	Mapped         uint64  `json:"mapped"`
	VmallocTotal   uint64  `json:"vmallocTotal"`
	VmallocUsed    uint64  `json:"vmallocUsed"`
	VmallocChunk   uint64  `json:"vmallocChunk"`
	HugePagesTotal uint64  `json:"hugePagesTotal"`
	HugePagesFree  uint64  `json:"hugePagesFree"`
	HugePagesRsvd  uint64  `json:"hugePagesRsvd"`
	HugePagesSurp  uint64  `json:"hugePagesSurp"`
	HugePageSize   uint64  `json:"hugePageSize"`
	AnonHugePage   uint64  `json:"anonHugePage"`
}

type NetInterface added in v0.5.0

type NetInterface struct {
	Index        int64    `json:"index"`
	Mtu          int64    `json:"mtu"`
	Name         string   `json:"name"`
	HardwareAddr string   `json:"hardwareAddr"`
	Flags        []string `json:"flags"`
	Addrs        []string `json:"addrs"`
}

type NetIo added in v0.5.0

type NetIo struct {
	Name        string `json:"name"`
	BytesSent   uint64 `json:"bytesSent"`
	BytesRecv   uint64 `json:"bytesRecv"`
	PacketsSent uint64 `json:"packetsSent"`
	PacketsRecv uint64 `json:"packetsRecv"`
}

type NetStat added in v0.5.0

type NetStat struct {
	NetIos        []NetIo        `json:"netIos"`
	NetInterfaces []NetInterface `json:"netInterfaces"`
}

type NodeInfo added in v0.5.0

type NodeInfo struct {
	NodeStat   NodeStat
	NodeReport NodeReport
}

type NodeReport added in v0.5.0

type NodeReport struct {
	CpuReport     string `json:"cpuReport"`
	DiskReport    string `json:"diskReport"`
	DockerReport  string `json:"dockerReport"`
	HostReport    string `json:"hostReport"`
	LoadReport    string `json:"loadReport"`
	MemReport     string `json:"memReport"`
	NetReport     string `json:"netReport"`
	ProcessReport string `json:"processReport"`
}

type NodeSight added in v0.5.0

type NodeSight interface {
	Init(context.Context) error
	Deinit(context.Context) error
	Run(context.Context) (NodeInfo, error)
}

func NodeSightNew added in v0.5.0

func NodeSightNew(_ context.Context, cfg *NodeSightConfig) NodeSight

type NodeSightConfig added in v0.5.0

type NodeSightConfig struct {
	Config config.Config
	Logger hclog.Logger
	Gpt    gpt.Gpt
	Ssh    ssh.Ssh
}

func DefaultNodeSightConfig added in v0.5.0

func DefaultNodeSightConfig() *NodeSightConfig

type NodeStat added in v0.5.0

type NodeStat struct {
	CpuStat     CpuStat     `json:"cpuStat"`
	DiskStat    DiskStat    `json:"diskStat"`
	DockerStat  DockerStat  `json:"dockerStat"`
	HostStat    HostStat    `json:"hostStat"`
	LoadStat    LoadStat    `json:"loadStat"`
	MemStat     MemStat     `json:"memStat"`
	NetStat     NetStat     `json:"netStat"`
	ProcessStat ProcessStat `json:"processStat"`
}

type ProcessInfo added in v0.5.0

type ProcessInfo struct {
	Background        bool              `json:"background"`
	CpuPercent        float64           `json:"cpuPercent"`
	Children          []int32           `json:"children"`
	Cmdline           string            `json:"cmdline"`
	Environs          []string          `json:"environs"`
	Ionice            int32             `json:"ionice"`
	IsRunning         bool              `json:"isRunning"`
	ProcessMemoryInfo ProcessMemoryInfo `json:"processMemoryInfo"`
	MemoryPercent     float32           `json:"memoryPercent"`
	Name              string            `json:"name"`
	NumFd             int32             `json:"numFd"`
	NumThread         int32             `json:"numThread"`
	Parent            int32             `json:"parent"`
	Ppid              int32             `json:"ppid"`
	ProcessRlimits    []ProcessRlimit   `json:"processRlimits"`
	Statuss           []string          `json:"statuss"`
	Uids              []int32           `json:"uids"`
	Username          string            `json:"username"`
}

type ProcessMemoryInfo added in v0.5.0

type ProcessMemoryInfo struct {
	Rss    uint64 `json:"rss"`
	Vms    uint64 `json:"vms"`
	Hwm    uint64 `json:"hwm"`
	Data   uint64 `json:"data"`
	Stack  uint64 `json:"stack"`
	Locked uint64 `json:"locked"`
	Swap   uint64 `json:"swap"`
}

type ProcessRlimit added in v0.5.0

type ProcessRlimit struct {
	Resource int32  `json:"resource"`
	Soft     uint64 `json:"soft"`
	Hard     uint64 `json:"hard"`
	Used     uint64 `json:"used"`
}

type ProcessStat added in v0.5.0

type ProcessStat struct {
	ProcessInfos []ProcessInfo `json:"processInfos"`
}

Jump to

Keyboard shortcuts

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