func (s *CompositeHTTPService) SumMetrics(metricNames []string, opts ...MetricsOption) ([]float64, error) {
	sums := make([]float64, len(metricNames))

	for _, service := range s.services {
		partials, err := service.SumMetrics(metricNames, opts...)
		if err != nil {
			return nil, err
		}

		if len(partials) != len(sums) {
			return nil, fmt.Errorf("unexpected mismatching sum metrics results (got %d, expected %d)", len(partials), len(sums))
		}

		for i := 0; i < len(sums); i++ {
			sums[i] += partials[i]
		}
	}

	return sums, nil
}
// SumMetrics returns the sum of the values of each given metric names.
SumMetrics returns the sum of the values of each given metric names.
// SumMetrics returns the sum of the values of each given metric names .
func (s *CompositeHTTPService) SumMetrics(metricNames []string, opts ...MetricsOption) ([]float64, error) {
	sums := make([]float64, len(metricNames))
	for _, service := range s.services {
		partials, err := service.SumMetrics(metricNames, opts...)
		if err != nil {
			return nil, err
		}
		if len(partials) != len(sums) {
			return nil, fmt.Errorf("unexpected mismatching sum metrics results (got %d, expected %d)", len(partials), len(sums))
		}
		for i := 0; i < len(sums); i++ {
			sums[i] += partials[i]
		}
	}
	return sums, nil
}
func ( s * CompositeHTTPService ) SumMetrics ( metricNames [ ] string , opts ... MetricsOption ) ( [ ] float64 , error ) { sums := make ( [ ] float64 , len ( metricNames ) ) for _ , service := range s . services { partials , err := service . SumMetrics ( metricNames , opts ... ) if err != nil { return nil , err } if len ( partials ) != len ( sums ) { return nil , fmt . Errorf ( " " , len ( partials ) , len ( sums ) ) } for i := 0 ; i < len ( sums ) ; i ++ { sums [ i ] += partials [ i ] } } return sums , nil }
SumMetrics returns the sum of the values of each given metric names.
SumMetrics returns the sum of the values of each given metric names .