func()

in opentelemetry_collector/receiver/nginxreceiver/nginx_stats_collector.go [172:199]


func (stats *LatencyStats) checkConsistency(bounds []float64) error {
	if len(bounds) == 0 || len(stats.Distribution) == 0 {
		return errors.New("One of the distribution values from the stats json is unset")
	}

	if len(bounds)+1 != len(stats.Distribution) {
		return errors.New("The length of the latency distribution and distribution bucket boundaries do not match")
	}

	if stats.RequestCount < 0 {
		return errors.New("The request count is less than 0")
	}

	if stats.SumSquares < 0 {
		return errors.New("The sum of squared latencies is less than 0")
	}

	if stats.LatencySum < 0 {
		return errors.New("The sum of latencies is less than 0")
	}

	for _, count := range stats.Distribution {
		if count < 0 {
			return errors.New("One of the latency distribution counts is less than 0")
		}
	}
	return nil
}