From 56cf0be13f5e8893805241022f7e6b1ed3be7f78 Mon Sep 17 00:00:00 2001 From: Francis Stephens Date: Wed, 22 Feb 2017 17:25:59 +0100 Subject: [PATCH] Adding GCCPUFraction metric to goCollector --- prometheus/go_collector.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/prometheus/go_collector.go b/prometheus/go_collector.go index 1ae9b8f..f967645 100644 --- a/prometheus/go_collector.go +++ b/prometheus/go_collector.go @@ -217,6 +217,14 @@ func NewGoCollector() Collector { ), eval: func(ms *runtime.MemStats) float64 { return float64(ms.LastGC) / 1e9 }, valType: GaugeValue, + }, { + desc: NewDesc( + memstatNamespace("gc_cpu_fraction"), + "The fraction of this program's available CPU time used by the GC since the program started.", + nil, nil, + ), + eval: func(ms *runtime.MemStats) float64 { return ms.GCCPUFraction }, + valType: GaugeValue, }, }, }