forked from mirror/client_golang
Merge pull request #104 from prometheus/remove-procfs-supported-fn
Inline and remove processCollectSupported().
This commit is contained in:
commit
3657dc8002
|
@ -81,7 +81,7 @@ func NewProcessCollectorPIDFn(
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set up process metric collection if supported by the runtime.
|
// Set up process metric collection if supported by the runtime.
|
||||||
if processCollectSupported() {
|
if _, err := procfs.NewStat(); err == nil {
|
||||||
c.collectFn = c.processCollect
|
c.collectFn = c.processCollect
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,13 +103,6 @@ func (c *processCollector) Collect(ch chan<- Metric) {
|
||||||
c.collectFn(ch)
|
c.collectFn(ch)
|
||||||
}
|
}
|
||||||
|
|
||||||
func processCollectSupported() bool {
|
|
||||||
if _, err := procfs.NewStat(); err == nil {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO(ts): Bring back error reporting by reverting 7faf9e7 as soon as the
|
// TODO(ts): Bring back error reporting by reverting 7faf9e7 as soon as the
|
||||||
// client allows users to configure the error behavior.
|
// client allows users to configure the error behavior.
|
||||||
func (c *processCollector) processCollect(ch chan<- Metric) {
|
func (c *processCollector) processCollect(ch chan<- Metric) {
|
||||||
|
|
Loading…
Reference in New Issue