func (g *Gauge) LabelValues() []string {
	return g.lvs
}
LabelValues returns the set of label values attached to the gauge.
package generic
import (
	"fmt"
	"io"
	"math"
	"sync"
	"sync/atomic"
	"github.com/VividCortex/gohistogram"
	"github.com/go-kit/kit/metrics"
	"github.com/go-kit/kit/metrics/internal/lv"
)
type Counter struct {
	Name string
	lvs  lv.LabelValues
	bits uint64
}
func NewCounter(name string) *Counter {
	return &Counter{
		Name: name,
	}
}
func (c *Counter) With(labelValues ...string) metrics.Counter {
	return &Counter{
		Name: c.Name,
		bits: atomic.LoadUint64(&c.bits),
		lvs:  c.lvs.With(labelValues...),
	}
}
func (c *Counter) Add(delta float64) {
	for {
		var (
			old  = atomic.LoadUint64(&c.bits)
			newf = math.Float64frombits(old) + delta
			new  = math.Float64bits(newf)
		)
		if atomic.CompareAndSwapUint64(&c.bits, old, new) {
			break
		}
	}
}
func (c *Counter) Value() float64 {
	return math.Float64frombits(atomic.LoadUint64(&c.bits))
}
func (c *Counter) ValueReset() float64 {
	for {
		var (
			old  = atomic.LoadUint64(&c.bits)
			newf = 0.0
			new  = math.Float64bits(newf)
		)
		if atomic.CompareAndSwapUint64(&c.bits, old, new) {
			return math.Float64frombits(old)
		}
	}
}
func (c *Counter) LabelValues() []string {
	return c.lvs
}
type Gauge struct {
	Name string
	lvs  lv.LabelValues
	bits uint64
}
func NewGauge(name string) *Gauge {
	return &Gauge{
		Name: name,
	}
}
func (g *Gauge) With(labelValues ...string) metrics.Gauge {
	return &Gauge{
		Name: g.Name,
		bits: atomic.LoadUint64(&g.bits),
		lvs:  g.lvs.With(labelValues...),
	}
}
func (g *Gauge) Set(value float64) {
	atomic.StoreUint64(&g.bits, math.Float64bits(value))
}
func (g *Gauge) Add(delta float64) {
	for {
		var (
			old  = atomic.LoadUint64(&g.bits)
			newf = math.Float64frombits(old) + delta
			new  = math.Float64bits(newf)
		)
		if atomic.CompareAndSwapUint64(&g.bits, old, new) {
			break
		}
	}
}
func (g *Gauge) Value() float64 {
	return math.Float64frombits(atomic.LoadUint64(&g.bits))
}