Skip to content

Commit bb85962

Browse files
authored
Add CPU and memory information (#25)
1 parent c177480 commit bb85962

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

api.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ type Resolution struct {
6363
HostParentProcessID int `json:"hostParentProcessId"`
6464
ProcessName string `json:"processName"`
6565
ProcessPath string `json:"processPath"`
66+
CpuUsage int `json:"cpuUsage"`
67+
MemoryUsage int `json:"memoryUsage"`
6668
ResolutionMechanism ResolutionMechanism `json:"resolutionMechanism"`
6769
sync.Mutex
6870
}
@@ -281,6 +283,20 @@ func (resolution *Resolution) SetProcessPath(ProcessPath string) *Resolution {
281283
return resolution
282284
}
283285

286+
func (resolution *Resolution) SetCpuUsage(CpuUsage int) *Resolution {
287+
resolution.Lock()
288+
defer resolution.Unlock()
289+
resolution.CpuUsage = CpuUsage
290+
return resolution
291+
}
292+
293+
func (resolution *Resolution) SetMemoryUsage(MemoryUsage int) *Resolution {
294+
resolution.Lock()
295+
defer resolution.Unlock()
296+
resolution.MemoryUsage = MemoryUsage
297+
return resolution
298+
}
299+
284300
func (resolution *Resolution) SetResolutionMechanism(ResolutionMechanism ResolutionMechanism) *Resolution {
285301
resolution.Lock()
286302
defer resolution.Unlock()

go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
2020
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
2121
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
2222
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
23-
github.com/kubeshark/api2 v0.0.0-20250613175225-65be260e56f6 h1:yDx1eb+qQ3hB3xHQzSP7MLTDAFW9/jWuKGUA1GpFG7U=
24-
github.com/kubeshark/api2 v0.0.0-20250613175225-65be260e56f6/go.mod h1:naOqOy71RRXeKPVH7/Vr2cGbyRDLg9sPKDBeOxdNCWU=
2523
github.com/kubeshark/api2 v0.0.0-20250616171331-0bb2df0d448a h1:+0APmVFqmmpibP2oluAdyqnD05z17iq+sSQvSXj2w2A=
2624
github.com/kubeshark/api2 v0.0.0-20250616171331-0bb2df0d448a/go.mod h1:naOqOy71RRXeKPVH7/Vr2cGbyRDLg9sPKDBeOxdNCWU=
2725
github.com/kubeshark/gopacket v1.1.30 h1:Dz6eo7b6+NdVCrgiyKxlGEVTm0L6PwgbVvSomsuwIyU=

0 commit comments

Comments
 (0)