You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2020/07/20 21:00:24 UTC

[GitHub] [trafficcontrol] srijeet0406 commented on a change in pull request #4892: /cdns/capacity returns 500 error: capacity was zero

srijeet0406 commented on a change in pull request #4892:
URL: https://github.com/apache/trafficcontrol/pull/4892#discussion_r457688787



##########
File path: traffic_ops/traffic_ops_golang/cdn/capacity.go
##########
@@ -166,21 +181,39 @@ func addCapacity(cap CapData, cacheStats CacheStats, crStates tc.CRStates, crCon
 		if !strings.HasPrefix(*cache.ServerType, string(tc.CacheTypeEdge)) {
 			continue
 		}
-		if len(stats.KBPS) < 1 || len(stats.MaxKBPS) < 1 {
-			continue
+		var kbps, maxKbps float64
+		for intName, intStats := range stats {
+			if len(intStats.KBPS) < 1 || len(intStats.MaxKBPS) < 1 {
+				continue
+			}
+			if checkServiceInterface(tx, intName, cacheName) {

Review comment:
       You mean once per interface, or once per cache?
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org