// Snapshot add metrics for Snapshot
Snapshot add metrics for Snapshot
// Snapshot add metrics for Snapshot
func (c *SimpleCollector) Snapshot(key string, deltas []string) {
	c.mu.Lock()
	defer c.mu.Unlock()
	c.metrics[key] = &SnapshotMetrics{
		key: key,
		value: &Map{
			v: make(map[string]struct{}),
		},
	}
	if v, ok := c.metrics[key].(*SnapshotMetrics); ok {
		for _, d := range deltas {
			v.value.set(d)
		}
	}
}
func ( c * SimpleCollector ) Snapshot ( key string , deltas [ ] string ) { c . mu . Lock ( ) defer c . mu . Unlock ( ) c . metrics [ key ] = & SnapshotMetrics { key : key , value : & Map { v : make ( map [ string ] struct { } ) , } , } if v , ok := c . metrics [ key ] . ( * SnapshotMetrics ) ; ok { for _ , d := range deltas { v . value . set ( d ) } } }
Snapshot add metrics for Snapshot
Snapshot add metrics for Snapshot
// add key and ignore existing key // add Snapshot, ignore otherwise