func (p IDInfo) GetStates() (States, error) {
	return p.States, nil
}
GetStates implements Proc.
package proc
import (
	"fmt"
	"os"
	"path/filepath"
	"strconv"
	"time"
	"github.com/prometheus/procfs"
)
var ErrProcNotExist = fmt.Errorf("process does not exist")
type (
	ID struct {
		Pid int
		StartTimeRel uint64
	}
	ThreadID ID
	Static struct {
		Name         string
		Cmdline      []string
		ParentPid    int
		StartTime    time.Time
		EffectiveUID int
	}
	Counts struct {
		CPUUserTime           float64
		CPUSystemTime         float64
		ReadBytes             uint64
		WriteBytes            uint64
		MajorPageFaults       uint64
		MinorPageFaults       uint64
		CtxSwitchVoluntary    uint64
		CtxSwitchNonvoluntary uint64
	}
	Memory struct {
		ResidentBytes         uint64
		VirtualBytes          uint64
		VmSwapBytes           uint64
		ProportionalBytes     uint64
		ProportionalSwapBytes uint64
	}
	Filedesc struct {
		Open int64
		Limit uint64
	}
	States struct {
		Running  int
		Sleeping int
		Waiting  int
		Zombie   int
		Other    int
	}
	Metrics struct {
		Counts
		Memory
		Filedesc
		NumThreads uint64
		States
		Wchan string
	}
	Thread struct {
		ThreadID
		ThreadName string
		Counts
		Wchan string
		States
	}
	IDInfo struct {
		ID
		Static
		Metrics
		Threads []Thread
	}
	Proc interface {
		GetPid() int
		GetProcID() (ID, error)
		GetStatic() (Static, error)
		GetMetrics() (Metrics, int, error)
		GetStates() (States, error)
		GetWchan() (string, error)
		GetCounts() (Counts, int, error)
		GetThreads() ([]Thread, error)
	}
	proccache struct {
		procfs.Proc
		procid  *ID
		stat    *procfs.ProcStat
		status  *procfs.ProcStatus
		cmdline []string
		io      *procfs.ProcIO
		fs      *FS
		wchan   *string
	}
	proc struct {
		proccache
	}
	procs interface {
		get(int) Proc
		length() int
	}
	procfsprocs struct {
		Procs []procfs.Proc
		fs    *FS
	}
	Iter interface {
		Next() bool
		Close() error
		Proc
	}
	procIterator struct {
		procs
		idx int
		err error
		Proc
	}
	Source interface {
		AllProcs() Iter
	}
	FS struct {
		procfs.FS
		BootTime    uint64
		MountPoint  string
		GatherSMaps bool
		debug       bool
	}
)
func (ii IDInfo) String() string {
	return fmt.Sprintf("%+v:%+v", ii.ID, ii.Static)
}
func (c *Counts) Add(c2 Delta) {
	c.CPUUserTime += c2.CPUUserTime
	c.CPUSystemTime += c2.CPUSystemTime
	c.ReadBytes += c2.ReadBytes
	c.WriteBytes += c2.WriteBytes
	c.MajorPageFaults += c2.MajorPageFaults
	c.MinorPageFaults += c2.MinorPageFaults
	c.CtxSwitchVoluntary += c2.CtxSwitchVoluntary
	c.CtxSwitchNonvoluntary += c2.CtxSwitchNonvoluntary
}
func (c Counts) Sub(c2 Counts) Delta {
	c.CPUUserTime -= c2.CPUUserTime
	c.CPUSystemTime -= c2.CPUSystemTime
	c.ReadBytes -= c2.ReadBytes
	c.WriteBytes -= c2.WriteBytes
	c.MajorPageFaults -= c2.MajorPageFaults
	c.MinorPageFaults -= c2.MinorPageFaults
	c.CtxSwitchVoluntary -= c2.CtxSwitchVoluntary
	c.CtxSwitchNonvoluntary -= c2.CtxSwitchNonvoluntary
	return Delta(c)
}
func (s *States) Add(s2 States) {
	s.Other += s2.Other
	s.Running += s2.Running
	s.Sleeping += s2.Sleeping
	s.Waiting += s2.Waiting
	s.Zombie += s2.Zombie
}
func (p IDInfo) GetThreads() ([]Thread, error) {
	return p.Threads, nil
}
func (p IDInfo) GetPid() int {
	return p.ID.Pid
}
func (p IDInfo) GetProcID() (ID, error) {
	return p.ID, nil
}
func (p IDInfo) GetStatic() (Static, error) {
	return p.Static, nil
}
func (p IDInfo) GetCounts() (Counts, int, error) {
	return p.Metrics.Counts, 0, nil
}
func (p IDInfo) GetMetrics() (Metrics, int, error) {
	return p.Metrics, 0, nil
}