func (g *groupRegistry) mustRegisterTimer(desc *desc) ID {
	desc.mt = timerMetricType
	g.mustRegister(desc)
	desc.id = newID(len(g.group.timers), g.desc.id)
	g.group.timers = append(g.group.timers, Timer{desc: desc})
	return desc.id
}
MustRegisterTimer registers a new timer metric using the provided descriptor.
If the metric name is not unique, MustRegisterTimer will panic.

MustRegisterTimer is not safe to call from multiple goroutines.
package metrics
import (
	"fmt"
	"sort"
)
type groupRegistry struct {
	desc        *groupDesc
	descriptors []*desc
	group       Group
}
func (g *groupRegistry) register(desc *desc) error {
	p := sort.Search(len(g.descriptors), func(i int) bool {
		return g.descriptors[i].Name == desc.Name
	})
	if p != len(g.descriptors) {
		return fmt.Errorf("metric name '%s' already in use", desc.Name)
	}
	g.descriptors = append(g.descriptors, desc)
	sort.Slice(g.descriptors, func(i, j int) bool {
		return g.descriptors[i].Name < g.descriptors[j].Name
	})
	return nil
}
func (g *groupRegistry) mustRegister(desc *desc) {
	if err := g.register(desc); err != nil {
		panic(err.Error())
	}
}
func (g *groupRegistry) mustRegisterCounter(desc *desc) ID {
	desc.mt = counterMetricType
	g.mustRegister(desc)
	desc.id = newID(len(g.group.counters), g.desc.id)
	g.group.counters = append(g.group.counters, Counter{desc: desc})
	return desc.id
}