func (m *tallyScope) RecordHistogramDuration(id int, value time.Duration) {
	def := m.defs[id]
	m.scope.Histogram(def.metricName.String(), m.getBuckets(id)).RecordDuration(value)
	if !def.metricRollupName.Empty() {
		m.rootScope.Histogram(def.metricRollupName.String(), m.getBuckets(id)).RecordDuration(value)
	}
}
Deprecated: not used
package metrics
import (
	"time"
	"github.com/uber-go/tally"
)
type tallyScope struct {
	scope             tally.Scope
	rootScope         tally.Scope
	defs              map[int]metricDefinition
	isNamespaceTagged bool
}
func newTallyScope(
	rootScope tally.Scope,
	scope tally.Scope,
	defs map[int]metricDefinition,
	isNamespace bool,
) Scope {
	return &tallyScope{
		scope:             scope,
		rootScope:         rootScope,
		defs:              defs,
		isNamespaceTagged: isNamespace,
	}
}
func NoopScope(serviceIdx ServiceIdx) Scope {
	return &tallyScope{
		scope:     tally.NoopScope,
		rootScope: tally.NoopScope,
		defs:      getMetricDefs(serviceIdx),
	}
}
func (m *tallyScope) IncCounter(id int) {
	m.AddCounter(id, 1)
}
func (m *tallyScope) AddCounter(id int, delta int64) {
	def := m.defs[id]
	m.scope.Counter(def.metricName.String()).Inc(delta)
	if !def.metricRollupName.Empty() {
		m.rootScope.Counter(def.metricRollupName.String()).Inc(delta)
	}
}
func (m *tallyScope) UpdateGauge(id int, value float64) {
	def := m.defs[id]
	m.scope.Gauge(def.metricName.String()).Update(value)
	if !def.metricRollupName.Empty() {
		m.scope.Gauge(def.metricRollupName.String()).Update(value)
	}
}
func (m *tallyScope) StartTimer(id int) Stopwatch {
	def := m.defs[id]
	timer := m.scope.Timer(def.metricName.String())
	switch {
	case !def.metricRollupName.Empty():
		return NewStopwatch(timer, m.rootScope.Timer(def.metricRollupName.String()))
	case m.isNamespaceTagged:
		timerAllDeprecated := m.scope.Tagged(map[string]string{namespace: namespaceAllValue}).Timer(def.metricName.String())
		timerAll := m.rootScope.Timer(def.metricName.String() + totalMetricSuffix)
		return NewStopwatch(timer, timerAll, timerAllDeprecated)
	default:
		return NewStopwatch(timer)
	}
}
func (m *tallyScope) RecordTimer(id int, d time.Duration) {
	def := m.defs[id]
	m.scope.Timer(def.metricName.String()).Record(d)
	switch {
	case !def.metricRollupName.Empty():
		m.rootScope.Timer(def.metricRollupName.String()).Record(d)
	case m.isNamespaceTagged:
		m.scope.Tagged(map[string]string{namespace: namespaceAllValue}).Timer(def.metricName.String()).Record(d)
		m.rootScope.Timer(def.metricName.String() + totalMetricSuffix).Record(d)
	}
}
func (m *tallyScope) RecordDistribution(id int, d int) {
	dist := time.Duration(d * distributionToTimerRatio)
	def := m.defs[id]
	m.scope.Timer(def.metricName.String()).Record(dist)
	switch {
	case !def.metricRollupName.Empty():
		m.rootScope.Timer(def.metricRollupName.String()).Record(dist)
	case m.isNamespaceTagged:
		m.scope.Tagged(map[string]string{namespace: namespaceAllValue}).Timer(def.metricName.String()).Record(dist)
		m.rootScope.Timer(def.metricName.String() + totalMetricSuffix).Record(dist)
	}
}