diff --git a/api.go b/api.go index 2392a48..0458096 100644 --- a/api.go +++ b/api.go @@ -63,6 +63,8 @@ type Resolution struct { HostParentProcessID int `json:"hostParentProcessId"` ProcessName string `json:"processName"` ProcessPath string `json:"processPath"` + CpuUsage int `json:"cpuUsage"` + MemoryUsage int `json:"memoryUsage"` ResolutionMechanism ResolutionMechanism `json:"resolutionMechanism"` sync.Mutex } @@ -281,6 +283,20 @@ func (resolution *Resolution) SetProcessPath(ProcessPath string) *Resolution { return resolution } +func (resolution *Resolution) SetCpuUsage(CpuUsage int) *Resolution { + resolution.Lock() + defer resolution.Unlock() + resolution.CpuUsage = CpuUsage + return resolution +} + +func (resolution *Resolution) SetMemoryUsage(MemoryUsage int) *Resolution { + resolution.Lock() + defer resolution.Unlock() + resolution.MemoryUsage = MemoryUsage + return resolution +} + func (resolution *Resolution) SetResolutionMechanism(ResolutionMechanism ResolutionMechanism) *Resolution { resolution.Lock() defer resolution.Unlock() diff --git a/go.sum b/go.sum index f49c0e6..b85f4ea 100644 --- a/go.sum +++ b/go.sum @@ -20,8 +20,6 @@ github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kubeshark/api2 v0.0.0-20250613175225-65be260e56f6 h1:yDx1eb+qQ3hB3xHQzSP7MLTDAFW9/jWuKGUA1GpFG7U= -github.com/kubeshark/api2 v0.0.0-20250613175225-65be260e56f6/go.mod h1:naOqOy71RRXeKPVH7/Vr2cGbyRDLg9sPKDBeOxdNCWU= github.com/kubeshark/api2 v0.0.0-20250616171331-0bb2df0d448a h1:+0APmVFqmmpibP2oluAdyqnD05z17iq+sSQvSXj2w2A= github.com/kubeshark/api2 v0.0.0-20250616171331-0bb2df0d448a/go.mod h1:naOqOy71RRXeKPVH7/Vr2cGbyRDLg9sPKDBeOxdNCWU= github.com/kubeshark/gopacket v1.1.30 h1:Dz6eo7b6+NdVCrgiyKxlGEVTm0L6PwgbVvSomsuwIyU=