remove prometheus namespace references, copy paste error

This commit is contained in:
Kevin Pike 2015-07-21 08:34:50 -07:00
parent b14b149930
commit 59305998f6
1 changed files with 24 additions and 26 deletions

View File

@ -4,25 +4,23 @@ import (
"runtime" "runtime"
"runtime/debug" "runtime/debug"
"time" "time"
"github.com/prometheus/client_golang/prometheus"
) )
type goCollector struct { type goCollector struct {
goroutines Gauge goroutines Gauge
gcDesc *Desc gcDesc *Desc
alloc prometheus.Gauge alloc Gauge
totalAlloc prometheus.Gauge totalAlloc Gauge
sys prometheus.Gauge sys Gauge
lookups prometheus.Gauge lookups Gauge
mallocs prometheus.Gauge mallocs Gauge
frees prometheus.Gauge frees Gauge
heapAlloc prometheus.Gauge heapAlloc Gauge
heapSys prometheus.Gauge heapSys Gauge
heapIdle prometheus.Gauge heapIdle Gauge
heapInuse prometheus.Gauge heapInuse Gauge
heapReleased prometheus.Gauge heapReleased Gauge
heapObjects prometheus.Gauge heapObjects Gauge
} }
// NewGoCollector returns a collector which exports metrics about the current // NewGoCollector returns a collector which exports metrics about the current
@ -37,73 +35,73 @@ func NewGoCollector() *goCollector {
"go_gc_duration_seconds", "go_gc_duration_seconds",
"A summary of the GC invocation durations.", "A summary of the GC invocation durations.",
nil, nil), nil, nil),
alloc: prometheus.NewGauge(prometheus.GaugeOpts{ alloc: NewGauge(GaugeOpts{
Namespace: "go", Namespace: "go",
Subsystem: "memstats", Subsystem: "memstats",
Name: "alloc_bytes", Name: "alloc_bytes",
Help: "Number of bytes allocated and still in use.", Help: "Number of bytes allocated and still in use.",
}), }),
totalAlloc: prometheus.NewCounter(prometheus.CounterOpts{ totalAlloc: NewCounter(CounterOpts{
Namespace: "go", Namespace: "go",
Subsystem: "memstats", Subsystem: "memstats",
Name: "alloc_bytes_total", Name: "alloc_bytes_total",
Help: "Total number of bytes allocated, even if freed.", Help: "Total number of bytes allocated, even if freed.",
}), }),
sys: prometheus.NewGauge(prometheus.GaugeOpts{ sys: NewGauge(GaugeOpts{
Namespace: "go", Namespace: "go",
Subsystem: "memstats", Subsystem: "memstats",
Name: "sys_bytes", Name: "sys_bytes",
Help: "Number of bytes obtained from system", Help: "Number of bytes obtained from system",
}), }),
lookups: prometheus.NewCounter(prometheus.CounterOpts{ lookups: NewCounter(CounterOpts{
Namespace: "go", Namespace: "go",
Subsystem: "memstats", Subsystem: "memstats",
Name: "lookups_total", Name: "lookups_total",
Help: "Total number of pointer lookups.", Help: "Total number of pointer lookups.",
}), }),
mallocs: prometheus.NewCounter(prometheus.CounterOpts{ mallocs: NewCounter(CounterOpts{
Namespace: "go", Namespace: "go",
Subsystem: "memstats", Subsystem: "memstats",
Name: "mallocs_total", Name: "mallocs_total",
Help: "Total number of mallocs.", Help: "Total number of mallocs.",
}), }),
frees: prometheus.NewCounter(prometheus.CounterOpts{ frees: NewCounter(CounterOpts{
Namespace: "go", Namespace: "go",
Subsystem: "memstats", Subsystem: "memstats",
Name: "frees_total", Name: "frees_total",
Help: "Total number of frees.", Help: "Total number of frees.",
}), }),
heapAlloc: prometheus.NewGauge(prometheus.GaugeOpts{ heapAlloc: NewGauge(GaugeOpts{
Namespace: "go", Namespace: "go",
Subsystem: "memstats", Subsystem: "memstats",
Name: "heap_alloc_bytes", Name: "heap_alloc_bytes",
Help: "Number heap bytes allocated and still in use.", Help: "Number heap bytes allocated and still in use.",
}), }),
heapSys: prometheus.NewCounter(prometheus.GaugeOpts{ heapSys: NewCounter(GaugeOpts{
Namespace: "go", Namespace: "go",
Subsystem: "memstats", Subsystem: "memstats",
Name: "heap_sys_bytes", Name: "heap_sys_bytes",
Help: "Total bytes in heap obtained from system.", Help: "Total bytes in heap obtained from system.",
}), }),
heapIdle: prometheus.NewGauge(prometheus.GaugeOpts{ heapIdle: NewGauge(GaugeOpts{
Namespace: "go", Namespace: "go",
Subsystem: "memstats", Subsystem: "memstats",
Name: "heap_idle_bytes", Name: "heap_idle_bytes",
Help: "Number bytes in heap waiting to be used.", Help: "Number bytes in heap waiting to be used.",
}), }),
heapInuse: prometheus.NewGauge(prometheus.GaugeOpts{ heapInuse: NewGauge(GaugeOpts{
Namespace: "go", Namespace: "go",
Subsystem: "memstats", Subsystem: "memstats",
Name: "heap_inuse_bytes", Name: "heap_inuse_bytes",
Help: "Number of bytes in heap that are in use.", Help: "Number of bytes in heap that are in use.",
}), }),
heapReleased: prometheus.NewGauge(prometheus.GaugeOpts{ heapReleased: NewGauge(GaugeOpts{
Namespace: "go", Namespace: "go",
Subsystem: "memstats", Subsystem: "memstats",
Name: "heap_released_bytes", Name: "heap_released_bytes",
Help: "Number of bytes in heap released to OS.", Help: "Number of bytes in heap released to OS.",
}), }),
heapObjects: prometheus.NewGauge(prometheus.GaugeOpts{ heapObjects: NewGauge(GaugeOpts{
Namespace: "go", Namespace: "go",
Subsystem: "memstats", Subsystem: "memstats",
Name: "heap_objects", Name: "heap_objects",