// Histogram add metrics for Histogram
Histogram add metrics for Histogram
// Histogram add metrics for Histogram
func (c *SimpleCollector) Histogram(key string, delta float64) {
	c.mu.Lock()
	defer c.mu.Unlock()
	if _, dup := c.metrics[key]; !dup {
		c.metrics[key] = &HistogramMetrics{
			key: key,
			value: &FloatSlice{
				v: make([]float64, 0),
			},
		}
	}
	if v, ok := c.metrics[key].(*HistogramMetrics); ok {
		v.value.v = append(v.value.v, delta)
	}
}
func ( c * SimpleCollector ) Histogram ( key string , delta float64 ) { c . mu . Lock ( ) defer c . mu . Unlock ( ) if _ , dup := c . metrics [ key ] ; ! dup { c . metrics [ key ] = & HistogramMetrics { key : key , value : & FloatSlice { v : make ( [ ] float64 , 0 ) , } , } } if v , ok := c . metrics [ key ] . ( * HistogramMetrics ) ; ok { v . value . v = append ( v . value . v , delta ) } }
Histogram add metrics for Histogram
Histogram add metrics for Histogram
// add key // add histogram, ignore otherwise