// Set add metrics for Set
Set add metrics for Set
// Set add metrics for Set
func (c *SimpleCollector) Set(key string, delta string) {
	c.mu.Lock()
	defer c.mu.Unlock()
	if _, dup := c.metrics[key]; !dup {
		c.metrics[key] = &SetMetrics{
			key: key,
			value: &Map{
				v: make(map[string]struct{}),
			},
		}
	}
	if v, ok := c.metrics[key].(*SetMetrics); ok {
		v.value.set(delta)
	}
}
func ( c * SimpleCollector ) Set ( key string , delta string ) { c . mu . Lock ( ) defer c . mu . Unlock ( ) if _ , dup := c . metrics [ key ] ; ! dup { c . metrics [ key ] = & SetMetrics { key : key , value : & Map { v : make ( map [ string ] struct { } ) , } , } } if v , ok := c . metrics [ key ] . ( * SetMetrics ) ; ok { v . value . set ( delta ) } }
Set add metrics for Set
Set add metrics for Set
// add key // add set, ignore otherwise