github.com/niedbalski/juju@v0.0.0-20190215020005-8ff100488e47/state/statemetrics/export_test.go (about) 1 // Copyright 2018 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package statemetrics 5 6 import "github.com/prometheus/client_golang/prometheus" 7 8 // In order to be able to use the prometheus testutil library, we need 9 // access to the actual GaugeVec values. 10 11 // ModelsGauge returns the internal gauge for testing. 12 func (c *Collector) ModelsGauge() *prometheus.GaugeVec { 13 return c.models 14 } 15 16 // MachinesGauge returns the internal gauge for testing. 17 func (c *Collector) MachinesGauge() *prometheus.GaugeVec { 18 return c.machines 19 } 20 21 // UsersGauge returns the internal gauge for testing. 22 func (c *Collector) UsersGauge() *prometheus.GaugeVec { 23 return c.users 24 } 25 26 // ScrapeDuration returns the internal gauge for testing. 27 func (c *Collector) ScrapeDurationGauge() prometheus.Gauge { 28 return c.scrapeDuration 29 } 30 31 // ScrapeErrors returns the internal gauge for testing. 32 func (c *Collector) ScrapeErrorsGauge() prometheus.Gauge { 33 return c.scrapeErrors 34 }