Adding Benchmarking to your Routing scripts: Difference between revisions
No edit summary |
No edit summary |
||
| (3 intermediate revisions by 2 users not shown) | |||
| Line 13: | Line 13: | ||
|} | |} | ||
Routing scripts | Routing scripts must be well designed to maximize the performance of a system. To help in the evaluation of the performance of a script (or part of a script), use this benchmarking tool.<br><br> | ||
To help | |||
Three lines need to be added to the script. <br> | |||
At the start of the script:<br> | At the start of the script:<br> | ||
require 'benchmark' | |||
In the main class, before the function to evaluate:<br> | In the main class, before the function to evaluate:<br> | ||
# Start benchmarking | |||
bm = Benchmark.measure do | bm = Benchmark.measure do | ||
In the main class, after the function to evaluate:<br> | In the main class, after the function to evaluate:<br> | ||
end #End benchamrking | |||
log_trace 3, "It took #{bm.real | log_trace 3, "It took #{'%.6f' % bm.real} seconds to do this function" | ||
This will print in the gateway application log the time it took to run this function. | This will print in the gateway application log the time it took to run this function. | ||
<br> | <br> | ||
Click here to know [[How_to_troubleshoot_call_routing#Using_the_applications_log_files|how to get the log files]] | Click here to know [[How_to_troubleshoot_call_routing#Using_the_applications_log_files|how to get the log files]] | ||
Latest revision as of 09:15, 13 June 2022
| This article applies to: | Product | Version |
| ProSBC | 3.1 | |
| Tmedia | 2.9, 2.10, 3.0, 3.2 |
Routing scripts must be well designed to maximize the performance of a system. To help in the evaluation of the performance of a script (or part of a script), use this benchmarking tool.
Three lines need to be added to the script.
At the start of the script:
require 'benchmark'
In the main class, before the function to evaluate:
# Start benchmarking bm = Benchmark.measure do
In the main class, after the function to evaluate:
end #End benchamrking
log_trace 3, "It took #{'%.6f' % bm.real} seconds to do this function"
This will print in the gateway application log the time it took to run this function.
Click here to know how to get the log files