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 2019/10/16 14:49:12 UTC

[GitHub] [trafficcontrol] mhoppa commented on issue #3982: Add Traffic Monitor gbps calculated stat.

mhoppa commented on issue #3982: Add Traffic Monitor gbps calculated stat.
URL: https://github.com/apache/trafficcontrol/pull/3982#issuecomment-542739084
 
 
   @vincentalfred you need to pass in all the arguments for the computedStats func so it would look like 
   ```
   func TestComputeStatGbps(t *testing.T) {
   	serverInfo := tc.TrafficServer{}
   	serverProfile := tc.TMProfile{}
   	combinedState := tc.IsAvailable{}
   	computedStats := ComputedStats()
   	got := computedStats["gbps"](ResultInfo{Vitals: Vitals{KbpsOut: 1500000}}, serverInfo, serverProfile, combinedState)
   	want := 1.5
   	if got != want {
   		t.Errorf("ComputedStats[\"gbps\"] return %v instead of %v", got, want)
   	}
   
   	got = computedStats["gbps"](ResultInfo{Vitals: Vitals{KbpsOut: 1400000}}, serverInfo, serverProfile, combinedState)
   	want = 1.4
   	if got != want {
   		t.Errorf("ComputedStats[\"gbps\"] return %v instead of %v", got, want)
   	}
   }
   ```
   
   And then it should work

----------------------------------------------------------------
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


With regards,
Apache Git Services