Skip to content

Commit

Permalink
Re-add deprecated methods used by elastic/go-sysinfo
Browse files Browse the repository at this point in the history
Fixes issue#169

Signed-off-by: Paul Gier <pgier@redhat.com>
  • Loading branch information
pgier committed Jun 3, 2019
1 parent 9b1831c commit 833678b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions proc.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,13 @@ func (fs FS) Self() (Proc, error) {
return fs.Proc(pid)
}

// NewProc returns a process for the given pid.
//
// Deprecated: use fs.Proc() instead
func (fs FS) NewProc(pid int) (Proc, error) {
return fs.Proc(pid)
}

// Proc returns a process for the given pid.
func (fs FS) Proc(pid int) (Proc, error) {
if _, err := os.Stat(fs.proc.Path(strconv.Itoa(pid))); err != nil {
Expand Down
8 changes: 8 additions & 0 deletions stat.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,14 @@ func NewStat() (Stat, error) {
return fs.Stat()
}

// NewStat returns information about current cpu/process statistics.
// See https://www.kernel.org/doc/Documentation/filesystems/proc.txt
//
// Deprecated: use fs.Stat() instead
func (fs FS) NewStat() (Stat, error) {
return fs.Stat()
}

// Stat returns information about current cpu/process statistics.
// See https://www.kernel.org/doc/Documentation/filesystems/proc.txt
func (fs FS) Stat() (Stat, error) {
Expand Down

0 comments on commit 833678b

Please sign in to comment.