Skip to content

Commit

Permalink
Write average throughput to output file
Browse files Browse the repository at this point in the history
  • Loading branch information
aminst committed Feb 27, 2024
1 parent 843d445 commit 63b1d80
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/client/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@ func WriteOutputToFile(outputFilePath string, responseCount []ResponseCount) err
return err
}
defer file.Close()
sum := 0.0
for _, count := range responseCount {
throughput := float64(count.readOperations + count.writeOperations)
sum += throughput
file.WriteString(fmt.Sprintf("Throughput: %f\n", throughput))
}
file.WriteString(fmt.Sprintf("Average Throughput: %f\n", sum/float64(len(responseCount))))
return nil
}

0 comments on commit 63b1d80

Please sign in to comment.