update procfs to v0.0.2 (#1376)

Signed-off-by: Paul Gier <pgier@redhat.com>
This commit is contained in:
Paul Gier 2019-06-12 13:47:16 -05:00 committed by Ben Kochie
commit 2bc133cd48
33 changed files with 167 additions and 172 deletions

View file

@ -55,7 +55,7 @@ func NewBuddyinfoCollector() (Collector, error) {
// Update calls (*buddyinfoCollector).getBuddyInfo to get the platform specific
// buddyinfo metrics.
func (c *buddyinfoCollector) Update(ch chan<- prometheus.Metric) error {
buddyInfo, err := c.fs.NewBuddyInfo()
buddyInfo, err := c.fs.BuddyInfo()
if err != nil {
return fmt.Errorf("couldn't get buddyinfo: %s", err)
}

View file

@ -155,7 +155,7 @@ func (c *cpuCollector) updateThermalThrottle(ch chan<- prometheus.Metric) error
// updateStat reads /proc/stat through procfs and exports cpu related metrics.
func (c *cpuCollector) updateStat(ch chan<- prometheus.Metric) error {
stats, err := c.fs.NewStat()
stats, err := c.fs.Stat()
if err != nil {
return err
}

View file

@ -80,7 +80,7 @@ func NewCPUFreqCollector() (Collector, error) {
// Update implements Collector and exposes cpu related metrics from /proc/stat and /sys/.../cpu/.
func (c *cpuFreqCollector) Update(ch chan<- prometheus.Metric) error {
cpuFreqs, err := c.fs.NewSystemCpufreq()
cpuFreqs, err := c.fs.SystemCpufreq()
if err != nil {
return err
}

View file

@ -106,7 +106,7 @@ func newIPVSCollector() (*ipvsCollector, error) {
}
func (c *ipvsCollector) Update(ch chan<- prometheus.Metric) error {
ipvsStats, err := c.fs.NewIPVSStats()
ipvsStats, err := c.fs.IPVSStats()
if err != nil {
// Cannot access ipvs metrics, report no error.
if os.IsNotExist(err) {
@ -121,7 +121,7 @@ func (c *ipvsCollector) Update(ch chan<- prometheus.Metric) error {
ch <- c.incomingBytes.mustNewConstMetric(float64(ipvsStats.IncomingBytes))
ch <- c.outgoingBytes.mustNewConstMetric(float64(ipvsStats.OutgoingBytes))
backendStats, err := c.fs.NewIPVSBackendStatus()
backendStats, err := c.fs.IPVSBackendStatus()
if err != nil {
return fmt.Errorf("could not get backend status: %s", err)
}

View file

@ -169,7 +169,7 @@ func pushMetric(ch chan<- prometheus.Metric, subsystem string, name string, valu
}
func (c *netClassCollector) getNetClassInfo() (sysfs.NetClass, error) {
netClass, err := c.fs.NewNetClass()
netClass, err := c.fs.NetClass()
if err != nil {
return netClass, fmt.Errorf("error obtaining net class info: %s", err)

View file

@ -82,7 +82,7 @@ func NewPressureStatsCollector() (Collector, error) {
func (c *pressureStatsCollector) Update(ch chan<- prometheus.Metric) error {
for _, res := range psiResources {
log.Debugf("collecting statistics for resource: %s", res)
vals, err := c.fs.NewPSIStatsForResource(res)
vals, err := c.fs.PSIStatsForResource(res)
if err != nil {
log.Debug("pressure information is unavailable, you need a Linux kernel >= 4.20 and/or CONFIG_PSI enabled for your kernel")
return nil

View file

@ -105,7 +105,7 @@ func (c *processCollector) getAllocatedThreads() (int, map[string]int32, int, er
thread := 0
procStates := make(map[string]int32)
for _, pid := range p {
stat, err := pid.NewStat()
stat, err := pid.Stat()
// PIDs can vanish between getting the list and getting stats.
if os.IsNotExist(err) {
log.Debugf("file not found when retrieving stats for pid %v: %q", pid, err)

View file

@ -80,7 +80,7 @@ func NewStatCollector() (Collector, error) {
// Update implements Collector and exposes kernel and system statistics.
func (c *statCollector) Update(ch chan<- prometheus.Metric) error {
stats, err := c.fs.NewStat()
stats, err := c.fs.Stat()
if err != nil {
return err
}