Skip to content

Commit

Permalink
Added more comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanratcliffe committed May 13, 2022
1 parent 3f357ca commit 948222a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions performance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,12 @@ func TimeRequests(numRequests int, linkDepth int, numParallel int) TimedResults
var expectedDuration time.Duration
for i := 0; i <= linkDepth; i++ {
thisLayer := int(math.Pow(2, float64(i))) * numRequests

// Expect that it'll take no longer that 200% of the sleep time. This is
// actually quite a lot of slack, and you likely won't need this much
// when running tests locally. But testing on shared platforms like
// Github actions you can see some pretty serious slowdowns that don't
// seem to be related to the tests
thisDuration := 200 * math.Ceil(float64(thisLayer)/float64(numParallel))
expectedDuration = expectedDuration + (time.Duration(thisDuration) * time.Millisecond)
expectedItems = expectedItems + thisLayer
Expand Down

0 comments on commit 948222a

Please sign in to comment.