registry.go
func New(flushInterval time.Duration, prefix string, tags ...string) *Registry {
	if flushInterval < time.Second {
		flushInterval = 30 * time.Second
	}

	r := &Registry{
		Logger:      log.New(os.Stderr, "instruments: ", log.LstdFlags),
		instruments: make(map[string]interface{}),
		prefix:      prefix,
		tags:        tags,
		closing:     make(chan struct{}),
		closed:      make(chan error, 1),
	}
	go r.loop(flushInterval)
	return r
}
func New(flushInterval time.Duration, prefix string, tags ...string) *Registry {
	if flushInterval < time.Second {
		flushInterval = 30 * time.Second
	}

	r := &Registry{
		Logger:      log.New(os.Stderr, "instruments: ", log.LstdFlags),
		instruments: make(map[string]interface{}),
		prefix:      prefix,
		tags:        tags,
		closing:     make(chan struct{}),
		closed:      make(chan error, 1),
	}
	go r.loop(flushInterval)
	return r
}
// New creates a new Registry with a flushInterval at which metrics
// are reported to the subscribed Reporter instances, a custom prefix
// which is prepended to every metric name and default tags.
// Default: 60s
//
// You should call/defer Close() on exit to flush all
// accummulated data and release all resources.