This topic describes how to use ~tensorbay.client.profile.Profile
to record speed statistics.
You can save the statistical record to a txt, csv or json file.
../../../docs/code/profile.py
Set multiprocess=True
to record the multiprocessing program.
../../../docs/code/profile.py
The above action would save a summary.txt file and the result is as follows:
|Path |totalTime (s) |callNumber |avgTime (s) |totalResponseLength |totalFileSize (B)|
|[GET] data06/labels |11.239 |25 |0.450 |453482 |0 |
|[GET] data06/data/urls |16.739 |25 |0.670 |794545 |0 |
|[POST] oss-cn-shanghai |0.567 |10 |0.057 |0 |8058707 |
Note
The profile will only record statistics of the interface that interacts with Tensorbay.