Skip to content

Commit 3657dc8

Browse files
committed
Merge pull request #104 from prometheus/remove-procfs-supported-fn
Inline and remove processCollectSupported().
2 parents 8ba7a93 + 7b2ff85 commit 3657dc8

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

prometheus/process_collector.go

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func NewProcessCollectorPIDFn(
8181
}
8282

8383
// Set up process metric collection if supported by the runtime.
84-
if processCollectSupported() {
84+
if _, err := procfs.NewStat(); err == nil {
8585
c.collectFn = c.processCollect
8686
}
8787

@@ -103,13 +103,6 @@ func (c *processCollector) Collect(ch chan<- Metric) {
103103
c.collectFn(ch)
104104
}
105105

106-
func processCollectSupported() bool {
107-
if _, err := procfs.NewStat(); err == nil {
108-
return true
109-
}
110-
return false
111-
}
112-
113106
// TODO(ts): Bring back error reporting by reverting 7faf9e7 as soon as the
114107
// client allows users to configure the error behavior.
115108
func (c *processCollector) processCollect(ch chan<- Metric) {

0 commit comments

Comments
 (0)