Skip to content

Commit

Permalink
VRF-1002: fix "Input must not be empty" error while getting load test…
Browse files Browse the repository at this point in the history
… metrics in load test (#12677)
  • Loading branch information
iljapavlovs authored Apr 3, 2024
1 parent f7aa507 commit 94d8cc5
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions integration-tests/contracts/ethereum_vrfv2plus_contracts.go
Original file line number Diff line number Diff line change
Expand Up @@ -634,17 +634,23 @@ func (v *EthereumVRFv2PlusLoadTestConsumer) GetLoadTestMetrics(ctx context.Conte
}
responseTimesInBlocks = append(responseTimesInBlocks, currentResponseTimesInBlocks...)
}
responseTimesInBlocksFloat64 := make([]float64, len(responseTimesInBlocks))
for i, value := range responseTimesInBlocks {
responseTimesInBlocksFloat64[i] = float64(value)
}
p90FulfillmentBlockTime, err := stats.Percentile(responseTimesInBlocksFloat64, 90)
if err != nil {
return nil, err
}
p95FulfillmentBlockTime, err := stats.Percentile(responseTimesInBlocksFloat64, 95)
if err != nil {
return nil, err
var p90FulfillmentBlockTime, p95FulfillmentBlockTime float64
if len(responseTimesInBlocks) == 0 {
p90FulfillmentBlockTime = 0
p95FulfillmentBlockTime = 0
} else {
responseTimesInBlocksFloat64 := make([]float64, len(responseTimesInBlocks))
for i, value := range responseTimesInBlocks {
responseTimesInBlocksFloat64[i] = float64(value)
}
p90FulfillmentBlockTime, err = stats.Percentile(responseTimesInBlocksFloat64, 90)
if err != nil {
return nil, err
}
p95FulfillmentBlockTime, err = stats.Percentile(responseTimesInBlocksFloat64, 95)
if err != nil {
return nil, err
}
}
return &VRFLoadTestMetrics{
RequestCount: requestCount,
Expand Down

0 comments on commit 94d8cc5

Please sign in to comment.