func (m *ClientImpl) AddCounter(scopeIdx int, metricIdx int, delta int64) {
	m.childReporters[scopeIdx].IncCounter(metricNames[metricIdx], nil, delta)
}
AddCounter adds delta to the counter and emits to the m3 backend
package metrics
import "time"
type ClientImpl struct {
	parentReporter Reporter
	childReporters map[int]Reporter
}
var metricNames []string
func init() {
	metricNames = make([]string, numMetrics)
	for _, serviceMetricDefs := range metricDefs {
		for idx, def := range serviceMetricDefs {
			metricNames[idx] = def.metricName
		}
	}
	for _, serviceMetricDefs := range dynamicMetricDefs {
		for idx, def := range serviceMetricDefs {
			metricNames[idx] = def.metricName
		}
	}
}
func NewClient(reporter Reporter, serviceIdx ServiceIdx) Client {
	commonMetricDefs := metricDefs[Common]
	serviceMetricDefs := metricDefs[serviceIdx]
	metricsMap := make(map[MetricName]MetricType, len(commonMetricDefs)+len(serviceMetricDefs))
	for _, m := range commonMetricDefs {
		metricsMap[MetricName(m.metricName)] = MetricType(m.metricType)
	}
	for _, m := range serviceMetricDefs {
		metricsMap[MetricName(m.metricName)] = MetricType(m.metricType)
	}
	childReporters := make(map[int]Reporter)
	initChildReporter := func(def scopeDefinition) Reporter {
		scopeTags := map[string]string{
			OperationTagName: def.operation,
		}
		mergeDictoRight(def.tags, scopeTags)  
		return reporter.GetChildReporter(scopeTags)
	}
	for scope, def := range scopeDefs[Common] {
		childReporters[scope] = initChildReporter(def)
		childReporters[scope].InitMetrics(metricsMap)
	}
	for scope, def := range scopeDefs[serviceIdx] {
		childReporters[scope] = initChildReporter(def)
		childReporters[scope].InitMetrics(metricsMap)
	}
	return &ClientImpl{
		parentReporter: reporter,
		childReporters: childReporters,
	}
}
func NewClientWithTags(m3Client Client, serviceIdx ServiceIdx, tags map[string]string) Client {
	reporter := m3Client.GetParentReporter()
	commonMetricDefs := dynamicMetricDefs[Common]
	serviceMetricDefs := dynamicMetricDefs[serviceIdx]
	metricsMap := make(map[MetricName]MetricType, len(commonMetricDefs)+len(serviceMetricDefs))
	for _, m := range commonMetricDefs {
		metricsMap[MetricName(m.metricName)] = MetricType(m.metricType)
	}
	for _, m := range serviceMetricDefs {
		metricsMap[MetricName(m.metricName)] = MetricType(m.metricType)
	}
	childReporters := make(map[int]Reporter)
	initChildReporter := func(def scopeDefinition, tags map[string]string) Reporter {
		scopeTags := map[string]string{
			OperationTagName: def.operation,
		}
		mergeDictoRight(def.tags, scopeTags)  
		mergeDictoRight(tags, scopeTags)      
		return reporter.GetChildReporter(scopeTags)
	}
	for scope, def := range dynamicScopeDefs[Common] {
		childReporters[scope] = initChildReporter(def, tags)
		childReporters[scope].InitMetrics(metricsMap)
	}
	for scope, def := range dynamicScopeDefs[serviceIdx] {
		childReporters[scope] = initChildReporter(def, tags)
		childReporters[scope].InitMetrics(metricsMap)
	}
	return &ClientImpl{
		parentReporter: reporter,
		childReporters: childReporters,
	}
}
func (m *ClientImpl) IncCounter(scopeIdx int, metricIdx int) {
	m.childReporters[scopeIdx].IncCounter(metricNames[metricIdx], nil, 1)
}