Merge pull request #1769 from zmyzheng/zmyzheng/support-process-page-faults-windows

feat(process_windows): Support collecting PageFault count in Windows
pull/1172/merge
shirou 1 week ago committed by GitHub
commit 6039e8f9d0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -260,7 +260,7 @@ Some code is ported from Ohai. Many thanks.
|children |x |x |x |x |x |
|connections |x | |x |x | |
|is\_running | | | | | |
|page\_faults |x | | | | |
|page\_faults |x | | | |x |
### gopsutil Original Metrics

@ -652,7 +652,17 @@ func (p *Process) MemoryInfoExWithContext(ctx context.Context) (*MemoryInfoExSta
}
func (p *Process) PageFaultsWithContext(ctx context.Context) (*PageFaultsStat, error) {
return nil, common.ErrNotImplementedError
mem, err := getMemoryInfo(p.Pid)
if err != nil {
return nil, err
}
ret := &PageFaultsStat{
// Since Windows does not distinguish between Major and Minor faults, all faults are treated as Major
MajorFaults: uint64(mem.PageFaultCount),
}
return ret, nil
}
func (p *Process) ChildrenWithContext(ctx context.Context) ([]*Process, error) {

Loading…
Cancel
Save