From 7b2ff852cae84c1ccf577fe7d897273d082736e6 Mon Sep 17 00:00:00 2001 From: Julius Volz Date: Wed, 1 Apr 2015 01:18:20 +0200 Subject: [PATCH] Inline and remove processCollectSupported(). --- prometheus/process_collector.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/prometheus/process_collector.go b/prometheus/process_collector.go index 222bf01..d8cf0ed 100644 --- a/prometheus/process_collector.go +++ b/prometheus/process_collector.go @@ -81,7 +81,7 @@ func NewProcessCollectorPIDFn( } // Set up process metric collection if supported by the runtime. - if processCollectSupported() { + if _, err := procfs.NewStat(); err == nil { c.collectFn = c.processCollect } @@ -103,13 +103,6 @@ func (c *processCollector) Collect(ch chan<- Metric) { 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 // client allows users to configure the error behavior. func (c *processCollector) processCollect(ch chan<- Metric) {