func (r *Reporter) Flush() error {
	for metricID := range r.refs {
		if r.refs[metricID]--; r.refs[metricID] < 1 {
			name, tags := instruments.SplitMetricID(metricID)
			r.Metric(name, tags, 0)
			delete(r.refs, metricID)
		}
	}
	if len(r.metrics) != 0 {
		if err := r.Client.Post(r.metrics); err != nil {
			return err
		}
		r.metrics = r.metrics[:0]
	}
	return nil
}
func (r *Reporter) Flush() error {
	for metricID := range r.refs {
		if r.refs[metricID]--; r.refs[metricID] < 1 {
			name, tags := instruments.SplitMetricID(metricID)
			r.Metric(name, tags, 0)
			delete(r.refs, metricID)
		}
	}
	if len(r.metrics) != 0 {
		if err := r.Client.Post(r.metrics); err != nil {
			return err
		}
		r.metrics = r.metrics[:0]
	}
	return nil
}
func ( r * Reporter ) Flush ( ) error { for metricID := range r . refs { if r . refs [ metricID ] -- ; r . refs [ metricID ] < 1 { name , tags := instruments . SplitMetricID ( metricID ) r . Metric ( name , tags , 0 ) delete ( r . refs , metricID ) } } if len ( r . metrics ) != 0 { if err := r . Client . Post ( r . metrics ) ; err != nil { return err } r . metrics = r . metrics [ : 0 ] } return nil }
// Flush implements instruments.Reporter
Flush implements instruments . Reporter